locked
Rob Ford's "Assign Directly" - Notification to analyst RRS feed

  • Question

  • This is in relation to Rob's solution here: http://gallery.technet.microsoft.com/Task-to-assign-an-incident-850ce363

    My question is, how would you include the "reassignment comment" from the action log in a notification template?  The idea is that it would be ideal to be able to use the "Assign Directly" and type a note to the analyst like "I need you to map a drive for this user" and when the analyst gets the "you have been assigned a helpdesk" notification that he gets my comment along with it. 

    I like the "Reassignment comment" bc the way I have it setup, anything from the analyst in the action log goes to the end user.  Where as with the "reassignment comment" i think there's the opportunity for that comment just to go to the analyst you are assigning it to. 

    Monday, March 26, 2012 4:34 PM

Answers

  • What I do myself, is I have an incident class extension property called AnalystLastComment. The comment from the re-assign gets copied to that. In the notification email template, I include this extension property. So, you would just need to adjust the code so that classIncident uses your class extension Guid, and then add a line before the Commt() similar to:

    emoSelIncident[classIncident, "YourCommentProperty"].Value = af.textComment.Text;

    For IDataItem, probably you can just use the same property name because this is not from a type projection.

    Does this answer your question?

    • Marked as answer by SCSMJOE Tuesday, April 3, 2012 4:27 PM
    Tuesday, April 3, 2012 6:57 AM

All replies

  • Or maybe what the name would be instead of > Name='WorkItem!System.WorkItem.TroubleTicketHasAnalystComment
    Wednesday, March 28, 2012 5:31 PM
  • What I do myself, is I have an incident class extension property called AnalystLastComment. The comment from the re-assign gets copied to that. In the notification email template, I include this extension property. So, you would just need to adjust the code so that classIncident uses your class extension Guid, and then add a line before the Commt() similar to:

    emoSelIncident[classIncident, "YourCommentProperty"].Value = af.textComment.Text;

    For IDataItem, probably you can just use the same property name because this is not from a type projection.

    Does this answer your question?

    • Marked as answer by SCSMJOE Tuesday, April 3, 2012 4:27 PM
    Tuesday, April 3, 2012 6:57 AM
  • P.S. If you ask questions related to gallery postings on the gallery itself, the posters (i.e. me, in this case) get a notification email.
    Tuesday, April 3, 2012 6:58 AM
  • Thanks Rob, that definitely answers my question and I'll make future posts in the gallery. 

    I have a question or two about getting this to work.  In AssignDirectlyToAnalystBasic.cs I have changed it to:

     //Get the incident class (System.WorkItem.Incident)
     ManagementPackClass classIncident = emg.EntityTypes.GetClass(new Guid("0E6CCCDF-CB0D-46B0-CA07-1DD97BC749E1"));

    and then

      //Set the source and target...
                            cemroAssignedToUser.SetSource(emoSelIncident);
                            cemroAssignedToUser.SetTarget(emoAssignToUser);

       //CUSTOM
       emoSelIncident[classIncident, "AnalystLastComment"].Value = af.textComment.Text;

                            //Save
                            cemroAssignedToUser.Commit();

    I extended the incident class with a new property named AnalystLastComment, and that is the GUID of the management pack.

    I'm not getting anything in the notification yet, but still trying to figure this out.  Does the solution need to be compiled before I reload the management pack?  Can you think of anything else that I might be forgetting to do?

    Tuesday, April 3, 2012 3:41 PM
  • Looks like you are not committing emoSelIncident, probably you should do this before creating and committing the relationship.
    Tuesday, April 3, 2012 6:42 PM
  • I see, Since then I have tried to create the relationship after the emoSelIncident commit() and a handful of other guesses.  I even started the process all over from scratch, but just can't quite seem to get there.  Thanks for your help anyways!
    Tuesday, April 3, 2012 7:50 PM
  • Your Guid should be Guid of the new extension class, not the MP, btw.

    Are you trapping exceptions in your task code to see if it is actually working or not? I'm guessing it is throwing an exception because the Guid is not a class, it's a Management Pack.

    What I often do for problematic workflows and console tasks is to put the code in a command line exe. This makes it much easier to test and debug. Once it is working, transfer the good code to the task or workflow.

    Tuesday, April 3, 2012 8:03 PM