locked
Combine First Response with First Assigned RRS feed

  • Question

  • Is it possible to set the first response time when an Incident Request gets first assigned? At the moment this is a two processes in the console.
    Friday, May 18, 2012 3:55 PM

Answers

  • You'll need a little bit of management pack magic to make it work.

    In your subscription's criteria, set a "Changed From" and "Changed To" condition on the First Assigned Date. Set the "Changed To" condition to be sometime in the past (like 1/1/2010 or something).

    Export the management pack where you stored your subscription.

    Open it with your favorite editor (I use notepad 'cause I'm a programming geek :) )

    Locate your subscription in the MP..it will be under <Monitoring>, <Rules>. There will be a rule with a funky ID (like "NotificationSubscription_someuglyguid").

    For the moment, we'll assume your subscription is the only rule in the MP. (if it's not, I'll explain how to find your rule shortly).

    Notice the criteria section..bunches of <Expression>, <And>, <SimpleExpression> nodes, etc.

    Notice that there are two expression contained within an <And> node. One of them has a <Property> node with State="Pre". This is the Expression node we're going to modify.

    So, for example, your node may look like this:

    <Expression>
        <SimpleExpression>
        <ValueExpression>
            <Property State="Pre">$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/FirstAssignedDate$</Property>
        </ValueExpression>
        <Operator>GreaterEqual</Operator>
        <ValueExpression>
            <Value>2012-01-01T04:00:00</Value>
        </ValueExpression>
        </SimpleExpression>
    </Expression>

    You're going to want it to look like this

    <Expression>
      <UnaryExpression>
        <ValueExpression>
            <Property State="Pre">$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/FirstAssignedDate$</Property>
        </ValueExpression>
        <Operator>IsNull</Operator>
      </UnaryExpression>
    </Expression>

    Notice the differences. Instead of a SimpleExpression, it's now a UnaryExpression. And instead of having a second ValueExpression, it just has an Operator..that operator is "IsNull". (I'll explain it all in a minute :) ) By the way, don't just copy and paste my example above..the <Property> node in your MP MUST remain the same..you can't just use the one I displayed above. So, just make the <Expression> node _around_ the <Property> node look like my example above.

    After you make this change to your MP, re-import it into service manager.

    Earlier we assumed your notification subscription was the only rule in the MP..what if it's not? Well, you gave your subscription a name when you configured it. That name is also stored in the management pack and references the actual subscription ID. Search the MP for the name you gave your subscription. You'll find it in a <DisplayString><Name> node towards the bottom... The DisplayString's "ElementID" attribute is the value you want to search for..it will be the ID of your subscription rule.

    So what exactly has this criteria change done? We have basically told service manager "I want this rule to trigger only when FirstAssignedDate is null, then it's changed to something greater than 1/1/2010".

    Sadly, this kind of criteria can't be configured in the console right now..but MPs are still pretty powerful. They can handle that kind of customization :)

    If the idea of modifying MPs by hand is overwhelming, no worries..it's just a learning curve we all had to get over :) Let me know if you have any questions about it, I'll give you some more details if you want them.


    Friday, May 18, 2012 9:38 PM

All replies

  • Not sure on this one, but what you could do thinking quickly is extend the class and create a custom workflow using powershell in the authoring tool to set the "First Response Time" date property and newly created IR goes from Assigned to User "Blank" to "Not Blank".

    Friday, May 18, 2012 4:19 PM
  • Yes, in SM2012, there's a "First Assigned Date" field on work items. So you can create a notification subscription to trigger when First Assigned Date is set.
    Friday, May 18, 2012 5:13 PM
  • hmmm tricky

    @Aaron - From what i can see the First Assigned Date criteria is set on a specific date in time (greater than, less than, equal to, etc), so not sure i can use that as won't it just get constantly triggered. What would the subscription trigger as a form template will only set the First Assigned date to be what it was set as when you applied it to the template, and not the current time?

    @Greg - A powershell script is probably the best way i guess, as we're using a similar thing for auto closing resolved requests after a certain period, just hoped it could be done another way. The trigger is the tricky bit, apart from writing the script of course, as i don't think there is a data property for assigned user under changed from. I could use a relationship subscription, as i have done for assigned user notifications, but this fires on any assignment/reassignment change.

    I guess i can have a workflow email out the exchange connector keyword for acknowledgment, at least that's one step solved, but a little round the houses.

    Friday, May 18, 2012 8:57 PM
  • You'll need a little bit of management pack magic to make it work.

    In your subscription's criteria, set a "Changed From" and "Changed To" condition on the First Assigned Date. Set the "Changed To" condition to be sometime in the past (like 1/1/2010 or something).

    Export the management pack where you stored your subscription.

    Open it with your favorite editor (I use notepad 'cause I'm a programming geek :) )

    Locate your subscription in the MP..it will be under <Monitoring>, <Rules>. There will be a rule with a funky ID (like "NotificationSubscription_someuglyguid").

    For the moment, we'll assume your subscription is the only rule in the MP. (if it's not, I'll explain how to find your rule shortly).

    Notice the criteria section..bunches of <Expression>, <And>, <SimpleExpression> nodes, etc.

    Notice that there are two expression contained within an <And> node. One of them has a <Property> node with State="Pre". This is the Expression node we're going to modify.

    So, for example, your node may look like this:

    <Expression>
        <SimpleExpression>
        <ValueExpression>
            <Property State="Pre">$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/FirstAssignedDate$</Property>
        </ValueExpression>
        <Operator>GreaterEqual</Operator>
        <ValueExpression>
            <Value>2012-01-01T04:00:00</Value>
        </ValueExpression>
        </SimpleExpression>
    </Expression>

    You're going to want it to look like this

    <Expression>
      <UnaryExpression>
        <ValueExpression>
            <Property State="Pre">$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem']/FirstAssignedDate$</Property>
        </ValueExpression>
        <Operator>IsNull</Operator>
      </UnaryExpression>
    </Expression>

    Notice the differences. Instead of a SimpleExpression, it's now a UnaryExpression. And instead of having a second ValueExpression, it just has an Operator..that operator is "IsNull". (I'll explain it all in a minute :) ) By the way, don't just copy and paste my example above..the <Property> node in your MP MUST remain the same..you can't just use the one I displayed above. So, just make the <Expression> node _around_ the <Property> node look like my example above.

    After you make this change to your MP, re-import it into service manager.

    Earlier we assumed your notification subscription was the only rule in the MP..what if it's not? Well, you gave your subscription a name when you configured it. That name is also stored in the management pack and references the actual subscription ID. Search the MP for the name you gave your subscription. You'll find it in a <DisplayString><Name> node towards the bottom... The DisplayString's "ElementID" attribute is the value you want to search for..it will be the ID of your subscription rule.

    So what exactly has this criteria change done? We have basically told service manager "I want this rule to trigger only when FirstAssignedDate is null, then it's changed to something greater than 1/1/2010".

    Sadly, this kind of criteria can't be configured in the console right now..but MPs are still pretty powerful. They can handle that kind of customization :)

    If the idea of modifying MPs by hand is overwhelming, no worries..it's just a learning curve we all had to get over :) Let me know if you have any questions about it, I'll give you some more details if you want them.


    Friday, May 18, 2012 9:38 PM
  • Wow Aaron that's perfect for the trigger, i totally get it.  Any ideas for the Write Action or should i just stick with my exchange connector keyword idea?

    I am pretty new to this, but i'm getting there. Managed to write an assignment/reassignment notification MP the other day, which involved a relationship subscription workflow setting a bool, then another seeing the bool and some other criteria before sending out the mail. Had to do that way as some guys here create requests that are already resolved, so no point in emailing about them. Took all day but it worked :-)

    Just on that i couldn't find a way to limit the relationship subscription to request updates only. As we already mail out on incident creation, which includes analyst assigned if already set. It's possible with instancesubscription, looks like it's not possible with relationshipsubscription.

    Friday, May 18, 2012 9:53 PM