Insight - Service Desk: Updating an object when a related service desk request is raised Edited

Hey, hoping for some help on this.

 

Example scenario: User requests a device using service desk (Ex. Requested Insight object KEY-123), once the user makes this request, I would like a custom status field on KEY-123 to be changed to "Reserved", and when this service desk request (Ex. DESK-11) is closed, I would like the status to change back to "in stock".

 

Is this something that needs to be created using a groovy script? Is there some documentation that might help point me in the right direction?

1 answer

1 accepted

This widget could not be displayed.

Hi Jonathan,

For this you would need to create an groovy script. We have an example at https://documentation.riada.se/insight/latest/insight-for-developers/groovy-scripting/groovy-script-examples/post-functions/update-object-attribute
And for a status the id has to be set, not the Name of the status.

Best Regards
Alexander

Hi Alexander, 

 

Thank you for your response. Can you guide me on how I would get it execute when a service desk ticket is created and that particular object is selected? Would this be done using ScriptRunner or Insight Automation?

 

Also in this script it has both insight and jira custom field, I'd only like to edit an insight custom field, so I can comment out the jira one?

Hi Jonathan,

I would suggest triggering this using an Insight post functions. One for the transition when the issue is created, and one for when the issue is closed.

Take a look at https://documentation.riada.se/insight/latest/insight-administrator-s-guide/insight-workflow-functions/insight-post-functions for information on how to trigger an Insight post function, and the one selected should be the groovy script post function.

Automation should not be used, as you need to react on issue creation, which you can't listen on as an event on automation.

The script is just an example and you need to change it. As you mentioned, you want to update the same object, so select the insight custom field, and then update that object instead.

Best Regards
Alexander

Just wanted to say thank you, I've got this setup now and made some additional progress thanks to this exercise.

Glad to hear :) 

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published Jul 25, 2018 in Marketplace Apps

Jira Cloud and Bitbucket Cloud Integration with Microsoft Teams

One of the newest products in the Microsoft family - Microsoft Teams,  is a chat-based hub for teamwork that integrates all the people, content, and tools your team needs to be more engaged and ...

717 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you