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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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
AUG Leaders

Atlassian Community Events