• Live
  • Update ticket with users device

    Table of Contents

    Creating your assets field

    Firstly, you need to either create a new custom field of type Assets objects or use the default Affected devices field.

    Once you have your Assets field, navigate to the custom field and edit the contexts.

    image-20240606-070657.png

    Then, Edit Assets object/s field configuration

    image-20240606-070730.png

    Now, select your Object schema where all of your synced information is stored and add the query below to the Filter scope (AQL).

    objecttype = "Devices"

    Then, select which field you want users to be able to manually and also the attributes that display on the ticket when linked. It should look something like this:

    You can now save the contexts and prepare to create the automation.

    Creating your automation

    Create an automation rule within JSM which you are using as your ITSM project with the below steps to automatically assign a users device using your synced data.

    Automation Step

    Configuration

    How it works

    Automation Step

    Configuration

    How it works

     

    When a new issue is create, this will trigger the automation

     

     

    We add a issue fields condition to add the request types where the device is captured. Use equals if you only have one Request Type to capture, if you have multiple, use is one of and then select the value(s).

     

     

    Here we are looking at the schema for the requester, select the Schema you are importing the data into and then use one of the following queries, depending on whether you prefer to use the UPN or Mail attribute primarily for users.

    objecttype = "Users" and "UPN" = "{{issue.reporter.emailAddress}}"

    objecttype = "Users" and "Mail" = "{{issue.reporter.emailAddress}}"

    To ensure you only retrieve one record, you can check the previous lookup step to ensure it only has a size of 1.

    First value:

    {{lookupObjects.size}}

    Second value:

    1

     

     

    Now we have found the User object within Assets, we now need to lookup the Device object, to do this we use the below query

    objecttype = "Devices" and "Registered Owner" = "{{lookupObjects}}"

    Again, to ensure you only retrieve one record, you can check the previous lookup step to ensure it only has a size of 1.

    First value:

    {{lookupObjects.size}}

    Second value:

    1

     

     

    Now we are adding an edit issue field which attaches the previously found Object to the issue. Select the Assets object field we create/edited earlier and add the query key = {{lookupObjects.key}}

    Now, you can log a ticket and as long as the user and device have synced through with the application, it will attach to the ticket.

     

    Please note that this automation will only work if there is 1 user object and the user object is attached to 1 device. If you have an environment where users have multiple devices and this is an issue, please reach out to Support and we can help.