locked
SCSM Incident template - auto-assign to current user RRS feed

  • Question

  • Hi,

    We have a incident template to create already-resolved incidents. I'm trying to find a way to automatically add the current analyst to the "Assigned to"-field.

    So when the analyst opens the template, the Assigned To property is already filled with her user name.

    Is something like this possible?

    In the MP XML I've found the Object with a relationship to System.WorkItemAssignedToUser (when I set a specific user as Assigned to), but I'm not sure if it's possible to somehow give this a dynamic variable, so the systems fetches the current user?

    Monday, July 15, 2013 11:00 AM

Answers

  • If you, or someone on your team, has some development experience with C#/WPF, you could accomplish this with a custom control on the Incident form.

    http://blog.scsmsolutions.com/2011/08/create-custom-user-control-for-scsm-2010/

    Conceptually you could create an "invisible" custom control using C#. You would place this invisible control on the form by extending the Incident form.

    When your control's data context changes you can apply the current user to the "AssignedUser" property of the data context.

    This is very similar to what Anton demos in his post:

    private void UserControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
    {
        // wait binding
        if (this.DataContext is IDataItem)
        {
            instance = (this.DataContext as IDataItem);
            // If this is new incident, set the default assigned-to user
            if ((bool)instance["$IsNew$"])
            {
                instance["AssignedUser"] = ConsoleContextHelper.Instance.CurrentUser;
            }
        }
    }
    

    Note that ConsoleContextHelper is just a helper class in the SDK..It can provide various information about the current console session, including the current user.
    Monday, July 15, 2013 9:19 PM

All replies

  • Applying a template wont remove data from a field, it will only write or over-write.  so as long as the Assigned To field on your template is empty the Assigned To user will not change.  

    In addition, I usually make individual templates for each analyst that has their name already in the Assigned To, the Impact & Urgency fields set, and other stuff if they need.  So you might consider making pre-resolved templates for each analyst.  


    - Get on the floor, do that dinosaur

    Monday, July 15, 2013 4:08 PM
  • Thanks for your reply, Pete.

    Yeah, I'm aware that applying a template don't remove data from fields. But we are using this template to quickly create new incidents (which would be resolved at the point of creation) - not applying it on already-created templates.

    Creating individual templates is unfortunately not an option in my case, as we are implementing SCSM to our entire organization, resulting in hundreds of analysts in the different departments. So creating individual templates is not realistic.

    We are using the quick close template as you describe, with many of the relevant fields already set, and it would be a great improvement to our analysts if there were a way to auto-fill the Assigned To field also, so they'd have as little work as possible, when using these quick close templates, and get on to the next incident.

    Monday, July 15, 2013 7:20 PM
  • If you, or someone on your team, has some development experience with C#/WPF, you could accomplish this with a custom control on the Incident form.

    http://blog.scsmsolutions.com/2011/08/create-custom-user-control-for-scsm-2010/

    Conceptually you could create an "invisible" custom control using C#. You would place this invisible control on the form by extending the Incident form.

    When your control's data context changes you can apply the current user to the "AssignedUser" property of the data context.

    This is very similar to what Anton demos in his post:

    private void UserControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
    {
        // wait binding
        if (this.DataContext is IDataItem)
        {
            instance = (this.DataContext as IDataItem);
            // If this is new incident, set the default assigned-to user
            if ((bool)instance["$IsNew$"])
            {
                instance["AssignedUser"] = ConsoleContextHelper.Instance.CurrentUser;
            }
        }
    }
    

    Note that ConsoleContextHelper is just a helper class in the SDK..It can provide various information about the current console session, including the current user.
    Monday, July 15, 2013 9:19 PM
  • Hi Aaron, thank you for your reply.

    Yea, that is definitely the right approach. We are anyway considering creating a custom gui for creating "standard" incidents (like password reset and whatnot), so a programming solution is welcome.

    Although my original question was if this could be done directly in a MPs XML, it was a bit far-fetched, so we will remember your answer, when we start the development of the custom incident forms.

    Thanks.

    Tuesday, July 16, 2013 7:17 AM