Forums

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

Automation: Iterating through issue changelog

Tomislav Tobijas
Community Champion
October 31, 2023

Hi,

One of our customers would like to get the following information in their report (when they export issues to Excel/CSV) - timestamp when the issue was first assigned to a user. I was thinking of creating a new custom field (date time field type) where this value would be stored + automation that would add that value based on assignee change (assignee added). However, this would cover only new issues, and for old ones, I would need to get that data somehow from Jira.

I managed to find this in the issue changelog, via URL https://<site_name>.atlassian.net/rest/api/latest/issue/<issue_key>?expand=changelog but the question is - can I, somehow with automation, go through all issues within some filter/JQL, and go through all changelogs for each issue, and find the value I'm looking for?

In the example below, you can see that in changelog entry #37, there is information that field "assignee" was changed from "null" to "<some_value>" and from there I would just need to get this "created" attribute value.2023-10-31_14-54-23.png

Any help with this would be appreciated 🙌

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 31, 2023

Hi @Tomislav Tobijas 

What is the problem your customer is trying to solve by having that information?  Knowing that may help the community to suggest additional solution approaches.

 

Back to your question...

Short answer to, "is this possible": maybe.

My recommendation: If you really want to do this, consider doing it with a marketplace addon that enhances the features of JQL, allowing such changelog queries.

 

Much longer answer:

If you still want to try this with a rule...

I believe the REST API function to get the change log returns pages, up to 100 entries at a time, and it returns the total number of entries.

And so a rule could, call the function once to get the count, create an advanced branch to iterate pages, and then repeatedly call the REST API function until it hits an assignment entry to update the custom field.  There are many challenges with this approach...

  • Assignee can be set at the time an issue is created.  This will not appear in the changelog as a change to the assignee.
  • You appear to want the first time of assignment, and not any assign / un-assign / assign cycles, and so the rule must process the entries in order.  Automation branches on more than one thing process in parallel and asynchronously.  Therefore there is likely no way with a rule to correctly enforce the order.
  • Rule branches are limited to 100 things.  In the unlikely event an issue has more than 10K entries, the rule would not find them.
  • Bigger problem: this type of rule would likely exceed the service limits for run-time, and so get throttled repeatedly

Kind regards,
Bill

Tomislav Tobijas
Community Champion
November 2, 2023

Cheers @Bill Sheboy !

I also suggested going with the add-on in the first place but I was also wondering if there was a free solution regarding this topic. My colleagues just forwarded this request to me so I don't know the whole background but generally, this specific client is used to generate numerous reports so I guess there was some idea regarding this request as well.

They've decided not to move forward with this (as it might use too many resources at this point) but if they decide to proceed with this, I'll surely try out the things you've mentioned.

Thanks for the help and for your insights/concerns about this approach!

Best,
Tomislav

Like • Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer