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,456,930
Community Members
 
Community Events
176
Community Groups

How to update a JSM issue Insight field with multiple values without overwriting the existing value

TL;DR - is it possible to simply add a value to a JSM Insight-backed custom field without overwriting the existing values?


We are doing a PoC with Insight as our CMDB and have two schemas, one of which has an object type named Business Application, a second schema that has an object type named Virtual Machine. We link each Virtual Machine object to a Business Application using an outbound reference.

We have a JSM incident request type called Report a system issue. The JSM form has two custom Insight fields: Affected Business Application(s) (that is tied to the Business Application Insight object type) and Affected IT Asset(s) (tied to the Virtual Machine Insight object type). During creation of a Report a system issue incident request type, populating the Affected IT Asset(s) field is required and the Business Application field is hidden.

We would like to use a Global Automation rule to retrieve the business application object linked to the VM object(s) specified in the Affected IT Asset(s) field and then update the business application custom field with that object. We have developed a Global Automation rule which works for a single VM assigned to a single business application and multiple VMs assigned to a single business application. That solves two of our three use cases but not the most complex.

Our most complex use case is probably best described using an actual real world use case - let's say an ESXi hypervisor server crashes. At the time of the crash the ESXi server was hosting 20 VMs. We have developed automation outside of JSM that updates the linkage of our VMs to ESXi servers in real-time, so in this use case we know exactly what VMs where running on that ESXi server when it crashed. An incident issue is automatically created using the Report a system issue and the ESXi host and each VM running on that host at the time of the crash is linked to the incident issue via the Affected IT Asset(s) Insight. Each VM potentially could be part of a different business application so we need to get the business application linked to each VM and add them to the Affected Business Application(s) custom field.

Today's challenge is how to execute the same process when multiple VM objects are assigned that are linked to different business applications. Branching is used currently to execute the Insight lookup for the VM to retrieve the linked business application. Next a step was added that simply edits the Affected Business Application(s) custom field on the issue. The problem is that each subsequent iteration of the For each: Smart value step overwrites the existing Affected Business Application(s) value, resulting in only the last iteration's value written.

I'm stumped here, in standard coding I would simply add the business application object to an array during each iteration and then build the Insight set array at the end. But since variables set within a branch cannot be "globalized" this wouldn't work (let alone trying to figure out how to build the Insight set array). I did try to set the "Copy from" option on the Edit Issue rule and targeted the Affected Business Application(s) from Current issue but my issue here is that I have to use the advanced field editing More options "fields" declaration to successfully edit the Insight-based custom field.

Any ideas?

2 answers

1 accepted

1 vote
Answer accepted

Well unfortunately I could not find a way to do this with Global Automation directly. Instead I wrote an AWS Lambda function that is triggered by Global Automation and that code takes care of add the multiple business applications back to the incident.

Hi @boswer01

 

If I have understood the above correctly. Are you able to use something like:

{{issue.customField_1000}}, <new value>

The reason for the smart value is os that it will retain previously entered values. You may also want to double check and see that your custom field can actually take multiple values in it. Go to custom fields, configure and then edit the configuration to check.

 

Dan

@Dan Tombsunfortunately no, the problem when appending the additional values is actually getting the other values in the other branches. Yes the custom field accepts multiple fields, it isn't that I can't add them, it's that I can't add them without blanking the existing value.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events