Is it better to use Jira Automation or ScriptRunner to calculate the % complete of an issue?

James Woyciesjes
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 20, 2024

I am looking to display the % Complete of an issue based on the number of child issues resolved and write that to a custom field so that I can display it in a Kanban Card.

I got it working using Jira Automation - setting up a rule to write a calculated value to a specific issue type on creation or update. See image below.

Is this the best way to do it or is it better to do something using ScriptRunner, possibly using a Listener and having that update the field?

 

image.png

Calculation in the Edit Issue fields is: 

{{#=}}{{OpenIssues}} / {{TotalCount}} * 100{{/}}%

2 answers

0 votes
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 2, 2024

Hi @James Woyciesjes - welcome to the community

I would not call any of the ways better. It depends on several subjective criterias eg. 

  • does it what it should?
  • how easy it should be to be maintain?
  • how likely will it be that it should be accessed by less-experienced/technical people?
  • etc...

 

I do a lot with A4J as well as Scriptrunner. Both of them will do the job you need perfectly (as you already solved with A4J)

As mentioned before A4J is easy accessible within the project. Also it doesn´t assume coding knowledge. so it´s quick and easy to use.

 

Mainly I use Scriptrunner for more complex use cases. One advantage (that could be interesting for this special use case here) that I personally like in scriptrunner over A4J is the update function. With scriptrunner you could send an update event after issue/field manipulation. Therefore it immerdiately shows the new field value. A4J does not send an update event therefore sometimes it will show edits after a refresh.

Please let us know if you have further inputs/questions.

Best
Stefan

0 votes
Chris Buzon
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.
November 20, 2024

I think you swapped OpenIssues with a resolved ones (resolution IS NOT empty means it's resolved).

Suggest an answer

Log in or Sign up to answer