Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,641,229
Community Members
 
Community Events
196
Community Groups

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?

2 answers

1 accepted

0 votes
Answer accepted
Alexander Sundström
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Nov 22, 2017

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?

Alexander Sundström
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Nov 24, 2017

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.

Alexander Sundström
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Nov 29, 2017

Glad to hear :) 

Hey Jonathan, would you be able to share how you got this done? Looking to do something similar.

Cancel that. Figured it out... 

Post function > Insight post function > Set the value of an object attribute with a predefined value > Set Status to Status ID number (not name).

Like Ricky LaFleur likes this

Hi @Alexander Sundström  

all links are deactivated could you please share other links so we can try it?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events