automatically setting first response date

Howdy,

I just wanted to know if anyone has found a good way of automatically setting the first response date.  I can see my service desk analysts not wanting to do this extra click.

The scenario I am looking for is this :

analyst opens call > assigns call to either self or another analyst > saves and closes the call

In the background I want this to happen :

When call is updated > if assigned to has changed from a null value to a not null value > then firstreponsedate = first assigneddate (or even current datetime)


I have played with smlets but am missing ability to set the value of responsedate(no option to set that in set-scsmincident).

I have also tried editing a template :

scenario: created a new incident template and manually set first response.  This sets the first response as the current datetime eg.04/10/2012 16:00, saved this to a new mp.  Exported said mp and now trying to hack the XML but am stuck as I do not know the model well enough.

screenshot below

can someone help me out or point me in the right direction?

Am even happy if someone knows a better method / process of auto setting this field.  I know exchange connector has this ability via response email, but this doesnt really work as it relies on the user replying to a auto generated email.





October 4th, 2012 3:07pm

Hi Humjill,

If you want to set the FirstResponseDate property using smlets, try this:

$incidentClass = get-scsmclass system.workitem.incident$
$incident = get-scsmobject -Class $incidentClass -Filter "Name -eq 'IR2'"
Set-SCSMObject -SMObject $incident -Property FirstResponseDate -Value ([DateTime]::UtcNow)
Where you need to pass the name as parameter.
Free Windows Admin Tool Kit Click here and download it now
October 4th, 2012 7:38pm

Hi Patrik,

thanks for you response, the powershell command you have provided seems almost too easy.  I will try this later on today and let you know.  On another note, would I be able to pass through a similar 'getcurrentdatetime' via hacking the XML?

thank

October 5th, 2012 8:06am

Hi Humjill,

No, it's not possible to set a value like "getcurrentdatetime" through a template.

Let me know if you need additional help with the smlets based solution.

Free Windows Admin Tool Kit Click here and download it now
October 5th, 2012 8:08am

Hi Patrik, that worked a treat thanks.  What cmdlets do i need to query to find out all the information for assigned to?, i.e. the analyst name the incident is assigned to, the assigned date etc?
October 5th, 2012 10:27am

Hi Humjill,

Here you go!

$incidentClass = get-scsmclass system.workitem.incident$
$wiAssignedToRelationship = Get-SCSMRelationshipClass System.WorkItemAssignedToUser$
$incident = get-scsmobject -Class $incidentClass -Filter "Name -eq 'IR2'"
#Get DisplayName of assigned user
$assignedTo = Get-SCSMRelatedObject -SMObject $incident -Relationship $wiAssignedToRelationship
Write-Host $assignedTo.DisplayName
#Get FirstAssignedDate
Write-Host $incident.FirstAssignedDate
Free Windows Admin Tool Kit Click here and download it now
October 5th, 2012 11:22am

I know this thread is already answered but I have attached the management pack in case anyone else was looking for the same solution.

This management pack will set the first response date to be the same as the first assigned date, when a service desk analyst either :

  • Creates a new ticket via the console and assigns it straight away  or
  • Updates an open ticket (not yet assigned) assigning the ticket to him/her self or another analyst.

You will need to copy the DLL to the service manager installation folder and then import the management pack

here you go. 

https://skydrive.live.com/redir?resid=3E3FB813CD60C4F7!135

  • Marked as answer by Humjill Monday, October 08, 2012 3:38 PM
October 8th, 2012 3:37pm

Perhaps this doesn't do what I am expecting it to do, as the First Response date is still showing blank when someone is assigned.

Does anyone know of a way to do this so that not only does the First Response critera get set, but the date/time is also recorded?

  • Proposed as answer by aabdelazim Monday, June 03, 2013 9:21 AM
  • Unproposed as answer by aabdelazim Monday, June 03, 2013 9:21 AM
Free Windows Admin Tool Kit Click here and download it now
January 15th, 2013 6:23pm

Hi Humjill,

Although this is an old thread, your solution is what we are looking for in our SCSM 2012 R2 environment. Are you able to publish your management pack again? (I tried the link but couldn't find it)

Thanks

June 8th, 2015 11:12pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics