Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira/JSM DC 9.12.x Assets - Automation within Assets to copy value from one attribute to another

Trudy Claspill
Community Champion
May 12, 2025

I am working with Jira/JSM Data Center.

I want to set up an Automation to run every week to select assets that have a date within the past 2 weeks.

For these assets I want to copy the value in one attribute to another attribute.

In Jira DC the Automation for Jira feature does not support specifying an AQL in the Schedule trigger (as far as I can tell). And I don't see an Advanced Branching feature (like in Cloud) that would allow me to iterate over a set of objects returned by the ScriptRunner action Lookup Asset (Insights) objects from AQL (IQL) with ScriptRunner

Looking at the Automation feature within Assets itself I see I can set up a scheduled rule and include AQL in the trigger.

I haven't been able to determine if there is a method within the Edit action to then set one attribute using the value of another attribute. The documentation doesn't show an example of doing that, and my internet searches have not yielded any useful information.

 

2 answers

1 accepted

3 votes
Answer accepted
Björn Gullander Eficode
Community Champion
May 13, 2025

Hi,

You can use the "old" Asset automations to do this. In the object schema configurations, add an automation rule triggered on scheduled event. Then setup the action "Update Attribute value" to copy the attribute value. Use asset placeholders to get source attribute value ${source attribute} to update the target attribute

/Björn

automation assets.png

Trudy Claspill
Community Champion
May 13, 2025

Placeholders, of course!

I'm still learning my way around Assets, and finding answers searching the internet requires that the correct question be asked. I had forgotten the term "placeholders".

This was exactly what I needed @Björn Gullander Eficode . Thank you!

1 vote
Kunal Kanojia
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 12, 2025

Hi,

Currently, there is no built-in automation rule available to execute this action directly.

However, you can utilise Groovy scripting within the Assets automation to achieve this functionality. For instance, the example titled ‘Update an object attribute’ found in the default examples set might provide the guidance you need, albeit with some additional coding.

For further details, please refer to the documentation here: https://confluence.atlassian.com/servicemanagementserver0512/groovy-script-examples-1402408458.html.

I hope this information proves helpful.

Best regards,

Kunal Kanojia
Jira Service Management DC Team

Trudy Claspill
Community Champion
May 12, 2025

Thank you for that suggestion @Kunal Kanojia .

I will spend some time working on that to see if I can generate a script to accomplish the tasks. I'll report back here how that turns out.

Like Kunal Kanojia likes this
Trudy Claspill
Community Champion
May 13, 2025

@Kunal Kanojia 

While @Björn Gullander Eficode 's answer satisfies the simple requirement for the question I posted, your answer will also be valuable. I have another scenario where I need to schedule selection of Assets and create an issue for each one. The issue types I am creating have a required field that I'm not seeing a way to set in the Create Issue action within Assets Automation, so I think the Groovy script option will be the solution.

Like Kunal Kanojia likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events