Forums

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

How to find date of status transition using rest API and Jira Automation

Jason Rittenhouse
Contributor
August 27, 2024

I have created automation that will auto populate an issue's due date when the issue transitions into the "ready" status. However, I need to run one-time automation to populate the due date for existing issues created in the past few months. So I need to figure out how to get the date of a past status transition.

 

Since this is a one-time need, I'm not interested in purchasing third party plugins and can hopefully pull this via the REST API. I've read several other posts that have gotten me started but I'm not getting any results with what I have so far.

First, I have the web request working. I can put in an issue to test and I get results in the payload showing the history of the issue. This is the web request URL I'm using: /rest/api/2/issue/{{issue.key}}?expand=changelog

 

To start with, I have this variable that I'm trying to get to work: 

{{#webhookResponse.body.changelog.histories}} {{created}}${{#items}}{{field.indexOf("status")}},{{toString.indexOf("Ready")}}x{{/}}#{{/}}

 

This supposedly will give me a list of every time the issue has entered the "Ready" status. The goal is then to extract the date of the first (most recent) entry. However, this very first variable is giving me zero results.

I need help getting the above variable working (and then I need another variable to extract the latest date) OR I need a different variable that can extract the latest Ready date without doing the two steps that I'm doing.

2 answers

0 votes
Juan Martín Bortolazzo February 5, 2025

Hi @Jason Rittenhouse :)

I'm looking for the same answer as you.

Have you been able to resolve this issue?

 

Regards,

0 votes
Mohamed Benziane
Community Champion
August 30, 2024

Hi, 

I will suggest to do the update in your script. It will be much easier than to deal with the automation variable

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events