Forums

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

How can I set values in an automation which were set in a previous Jira issue?

Nadine Arnold January 24, 2025

To my problem. To make it easier for a few teams, we create issues for them automatically every working day, so they just have to fill in their actual number for this day. In this case it is the daily headcount. 

Due to the fact that not every day the numbers change, I would like to change the automation, that the values of the previous day get copied - if they afterwards change the values manually, these new numbers shall be copied to the next days issues.

This is how my automation looks like - very simple, just creating issues for all teams. But with now values. I know how to set them fix, but I want it to be dynamic, so always the "latest" one is set for the next day

 

Automation.jpgAutomation II.jpg

1 answer

0 votes
Tessa Tuteleers
Community Champion
January 24, 2025

Hi @Nadine Arnold , 

It looks like you are doing this for different teams at the same time? 

First you should identify the latest issue for the correct team. 
You could do this by searching for the issues with a JQL. 

for example: 

issuetype = Headcount AND reporter = "Automation for Jira" AND Factory = REC-2 AND Department = REC-46 AND "Org team" = REC-48 AND created > -10d ORDER BY created DESC

-> This wil get you a list of issues created by A4J for that team in the last 10 days. Ordering by created makes sure the last issue is the first one in the list. 
-> I use a list of the last 10 days, wo make sure even after weekend, holidays,.. there will always be an earlier issue in scope. Adjust to your preference. 

 

Secondly, Now that we have identified the correct issue,  we need to get the value of that issue in a smart value so you can use it to create the next one. 

You can find info about working with lists here

 

So, before every "Create issue" action in your rule, you first need to do a "lookup issues" with the correct query (see my example and ammend to make sure you get the correct issues)

After that, you need an action "Create variable" and get the value from the issue with this format: 

{{lookupIssues.first.customfield_xxx}}

After first. -> use the customfield_id format if you know the id of the field, or jsut use the name if you prefer (but not best practice).

Name your variable somthing easy and use that as the smart value in your creation. 

 

Please try this out and see if it works for you. 

- Tessa

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events