Forums

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

Calculated non-numerical field (or alternative) in Epic based on Stories

lukasz.lichota December 1, 2020

hi community, 

Looking for inspiration how to use JIRA automation (or potentially JSU) to solve this problem.

At Story level I have a custom field with enumerated values of "Red", "Amber", "Green".
I'd like to have a similar field at Epic level that automatically updates to "the worst" value from the Epic's children Stories (if any is Red then Red else if any is Amber then Amber else Green). Any thoughts?

(That's JIRA Cloud) 

3 answers

1 accepted

1 vote
Answer accepted
Flavien Gache
Community Champion
December 1, 2020

Hi.

It should be something like this :

When field value changed, fields to monitor : color (I guess) for all issues operation.

If/else rule. If matches (field color, condition equals, value red), for parent...

Here is a screenshot with the field resolution to show you the logic. You just have to put the right fields.

Tell me if it worked :)

Screenshot 2020-12-01 at 17.02.45.png

lukasz.lichota December 2, 2020

thanks a lot @Flavien Gache, I managed to do most of logic using this approach. 
I realised that there is piece of logic that would depend on other children of the Epic - do you know if these could be accessed anyhow?

(Probably doesn't matter for the question but the piece of logic I'm talking about is making the RAG green again after it was Amber or Red. It can only "go down" if there is no other Story with higher value, so e.g. if I change a value in one of the Stories from Amber to Green, I cannot change parent Epic to Green without verifying first no other Story has also Amber) 

Like Flavien Gache likes this
0 votes
David Fischer
Community Champion
February 22, 2021

Hi @lukasz.lichota ,

In case you never found a solution, this can be achieved using JMWE's Event-based Actions.

You could create an event-based action that reacts to the Issue Field Value Changed event for your custom field, limiting its scope to Stories. And as the action, use a Set Field Value post-function to set the value of your custom field on the issue's parent Epic, with a value like:

{% set values = targetIssue | stories("customfield_12345") | field("fields.customfield_12345.value") %}
{% if values.includes("Red") %}
Red
{% elif values.includes("Amber") %}
Amber
{%else%}
Green
{%endif%}

where customfield_12345 is the custom field ID of your single-select custom field. 

0 votes
Michael Nidel {Appfire} December 9, 2020

Hi @lukasz.lichota

It should be like this:

Following JSU post functions with preconditions can do the logic:

jsucloud_solution_001.jpg

They can be added to any transition of workflow for issues in epic.

Tell me if it worked :)

lukasz.lichota December 10, 2020

Thanks @Michael Nidel {Appfire}
interesting to see how it could work, but I'm afraid these items doesn't go through any transition during that period. RAG is delivery confidence that changes while all things are still "In Progress" status so I'd need a "field edited" trigger rather than transition trigger.

Suggest an answer

Log in or Sign up to answer