Incident View that includes multiple "Assigned To User"

Răspuns Incident View that includes multiple "Assigned To User"

  • 29 martie 2012 15:41
     
     

    Here is what I am trying to do...

    Setup a view for Incidents assiged to "me" plus incidents assigned to "networking" within the same view.  The views work just fine on their own but cannot create a view that includes both "me" and "networking" for my criteria. 

    Ideally i would like to see within the same view all open tickets assigned to me along with all open tickets assigned to networking.

    Thank you.

Toate mesajele

  • 29 martie 2012 18:27
    Moderator
     
     Răspuns Are cod

    You'll probably need to edit the XML criteria directly.

    Have you tried doing something like this?

    <Expression>
      <Or>
        <Expression>
          <SimpleExpression>
            <ValueExpressionLeft>
              <GenericProperty Path="$Context/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$">Id</GenericProperty>
            </ValueExpressionLeft>
            <Operator>Equal</Operator>
            <ValueExpressionRight>
              <Token>[me]</Token>
            </ValueExpressionRight>
          </SimpleExpression>
        </Expression>
        <Expression>
          <SimpleExpression>
            <ValueExpressionLeft>
              <GenericProperty Path="$Context/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$">Id</GenericProperty>
            </ValueExpressionLeft>
            <Operator>Equal</Operator>
            <ValueExpressionRight>
              <Value>{GUID-of-the-networking-CI-object}</Value>
            </ValueExpressionRight>
          </SimpleExpression>
        </Expression>
      </Or>
    </Expression>

    Or, you could create a view for [me] and [mygroups] (if Networking is an AD group) like this:

    <Expression>
      <In>
        <GenericProperty Path="$Context/Path[Relationship='WorkItem!System.WorkItemAssignedToUser' SeedRole='Source']$">Id</GenericProperty>
        <Values>
          <Token>[me]</Token>
          <Token>[mygroups]</Token>
        </Values>
      </In>
    </Expression>

  • 30 martie 2012 19:17
     
     

    Thanks for posting this - I have been trying to set this up but am struggling a bit with the xml portion (I made the change and then imported the mp but recieved an error when going to the actual view - did not recieve an error when importing. 

    I am going to try your second suggestion and see what happens.

  • 3 aprilie 2012 06:46
    Moderator
     
     
    If you post the xml for the failed view I'll take a look
  • 3 aprilie 2012 14:46
    Moderator
     
     Răspuns
    Tip: To avoid export-import procedure you can use this tool http://gallery.technet.microsoft.com/Advanced-View-Editor-e4592390

    http://www.scsmsolutions.com/ freemanru (at) gmail (dot) com

  • 3 aprilie 2012 17:49
     
     

    Here is my xml - I can't seem to figure out what I am doing wrong here (I shoudl add that I am new to xml editing)

    Thanks again for the help...

    <QueryCriteria xmlns="http://tempuri.org/Criteria.xsd" Adapter="omsdk://Adapters/Criteria"> <Criteria> <FreeformCriteria> <Freeform><Criteria  xmlns="http://Microsoft.EnterpriseManagement.Core.Criteria/">
      <Expression>
    <Or>
        <SimpleExpression>
          <ValueExpressionLeft>
            <GenericProperty Path="$Context/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$">Id</GenericProperty>
          </ValueExpressionLeft>
          <Operator>Equal</Operator>
          <ValueExpressionRight>
            <Token>[me]</Token>
          </ValueExpressionRight>
        </SimpleExpression>
      </Expression>
    <SimpleExpression>
          <ValueExpressionLeft>
            <GenericProperty Path="$Context/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$">Id</GenericProperty>
          </ValueExpressionLeft>
          <Operator>Equal</Operator>
          <ValueExpressionRight>
            <Value>{70600C45-9435-43F4-801D-4386DA57E378}</Value>
          </ValueExpressionRight>
        </SimpleExpression>
      </Expression>
    </Or>
    </Expression>
    </Criteria> </Freeform> </FreeformCriteria> </Criteria> </QueryCriteria>

  • 3 aprilie 2012 18:34
    Moderator
     
      Are cod

    Try this:

    <Criteria>
      <QueryCriteria Adapter="omsdk://Adapters/Criteria" xmlns="http://tempuri.org/Criteria.xsd">
        <Criteria>
          <FreeformCriteria>
            <Freeform>
              <Criteria xmlns="http://Microsoft.EnterpriseManagement.Core.Criteria/">          
                    <Expression>
                      <Or>
                        <Expression>
                          <SimpleExpression>
                            <ValueExpressionLeft>
                              <GenericProperty Path="$Context/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$">Id</GenericProperty>
                            </ValueExpressionLeft>
                            <Operator>Equal</Operator>
                            <ValueExpressionRight>
                              <Token>[me]</Token>
                            </ValueExpressionRight>
                          </SimpleExpression>
                        </Expression>
                        <Expression>
                          <SimpleExpression>
                            <ValueExpressionLeft>
                              <GenericProperty Path="$Context/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$">Id</GenericProperty>
                            </ValueExpressionLeft>
                            <Operator>Equal</Operator>
                            <ValueExpressionRight>
                              <Value>{70600C45-9435-43F4-801D-4386DA57E378}</Value>
                            </ValueExpressionRight>
                          </SimpleExpression>
                        </Expression>
                      </Or>                   
                </Expression>
              </Criteria>
            </Freeform>
          </FreeformCriteria>
        </Criteria>
      </QueryCriteria>
    </Criteria>
    Or give Anton's excellent Advanced View Editor a try :)

  • 3 aprilie 2012 18:38
    Moderator
     
     

    If I quite remember you can't use GUID string as criteria values (I will check and write later about this). So try to change criteria and use Domain and UserName properties to filter AssignedTo field.


    http://www.scsmsolutions.com/ freemanru (at) gmail (dot) com

  • 3 aprilie 2012 18:57
    Moderator
     
     Răspuns propus Are cod

    Hmm, actually, that might explain a problem I was looking at the other day, thanks, Anton.

    Almanza, so try the 2nd expression as something like:

    <Expression>
      <SimpleExpression>
        <ValueExpressionLeft>
          <Property>$Context/Path[Relationship='WorkItem!System.WorkItemAssignedToUser' TypeConstraint='System!System.Domain.User']/Property[Type='System!System.Domain.User']/UserName$</Property>
        </ValueExpressionLeft>
        <Operator>Equal</Operator>
        <ValueExpressionRight>
          <Value>samAccountName</Value>
        </ValueExpressionRight>
      </SimpleExpression>
    </Expression>


  • 4 aprilie 2012 19:02
     
     
    Hey Anton, any idea when the 2012 version will be ready?
  • 4 aprilie 2012 19:06
    Moderator
     
     

    Testing against RTM is in progress... Week, may be two...


    http://www.scsmsolutions.com/ freemanru (at) gmail (dot) com

  • 5 aprilie 2012 14:06
     
     
    Excellent! Thank you for the prompt response.