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.
Hi @Jason Rittenhouse :)
I'm looking for the same answer as you.
Have you been able to resolve this issue?
Regards,
Hi,
I will suggest to do the update in your script. It will be much easier than to deal with the automation variable
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!
Help us plant more trees
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.