none
Incident View that includes multiple "Assigned To User" RRS feed

  • Question

  • 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.

    Thursday, March 29, 2012 3:41 PM

Answers

  • 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>

    Thursday, March 29, 2012 6:27 PM
    Moderator
  • 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

    Tuesday, April 3, 2012 2:46 PM
    Moderator

All replies

  • 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>

    Thursday, March 29, 2012 6:27 PM
    Moderator
  • 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.

    Friday, March 30, 2012 7:17 PM
  • If you post the xml for the failed view I'll take a look
    Tuesday, April 3, 2012 6:46 AM
    Moderator
  • 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

    Tuesday, April 3, 2012 2:46 PM
    Moderator
  • 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>

    Tuesday, April 3, 2012 5:49 PM
  • 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 :)

    Tuesday, April 3, 2012 6:34 PM
    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

    Tuesday, April 3, 2012 6:38 PM
    Moderator
  • 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>


    Tuesday, April 3, 2012 6:57 PM
    Moderator
  • Hey Anton, any idea when the 2012 version will be ready?
    Wednesday, April 4, 2012 7:02 PM
  • Testing against RTM is in progress... Week, may be two...


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

    Wednesday, April 4, 2012 7:06 PM
    Moderator
  • Excellent! Thank you for the prompt response.
    Thursday, April 5, 2012 2:06 PM
  • 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

    You are correct, I was struggling so hard with a simple "Assigned To Id" and it turns out I had to use "In" and then it worked, before it was giving a horrible "Invalid column name S for query Component_LoopQuery_9cc39579-e071-cca8-ef6e-07263620b87f"

    But now it works!

    return @"<Criteria xmlns='http://Microsoft.EnterpriseManagement.Core.Criteria/'>
    			<Reference Id='" + workItemMP.Name + @"' PublicKeyToken='" + workItemMP.KeyToken + @"' Version='" + workItemMP.Version.ToString() + @"' Alias='WorkItem' />  
    			<Reference Id='" + coreIRMP.Name + @"' PublicKeyToken='" + coreIRMP.KeyToken + @"' Version='" + coreIRMP.Version.ToString() + @"' Alias='Incident' />  
    			<Expression>
    				<In>"
    			   + "<GenericProperty Path=\"$Context/Path[Relationship='WorkItem!System.WorkItemAssignedToUser']$\">Id</GenericProperty>" +
    				@"<Values>
    					<Value>" + "{" + str_scsmUserGUID + "}" + @"</Value>
    				  </Values>
    				</In>
    			</Expression>
    		</Criteria>";


    Monday, October 24, 2016 9:55 PM