I have an automation to run
wherein
I have portfolio epics, and epics as child task of PE
I have number field in both: Say A for PE and B for Epic
I want to make average of B and give it to A
How can I make it?
I have tried in staging environment, but I am not able to fetch the lookup issues to have their field value to make average
Hello @Bhuushan Jaju ,
As per my understanding you want average of "Number field" of Epic and display that in PE Number field.
You can achieve this by Automation for Jira.
In which you can have 2 Automation with triggers based on whenever Field Value change and whenever there is changes in the Child Parent relation (like Epic is added or removed from PE)
or you can schedule it to run once everyday.
Automation should look like below.
1. Have a lookUp issue to identify all associated child to a Parent.
"parent" = {{triggerIssue.parent}}
2. Then Create a Variable to count number of Child in Parent ticket
{{lookupIssues.size|0}}
3. Now for create a Branch and select for Parent. and edit the Number Field Custom field.
Avergae of Number field value for Parent should be: {{lookupIssues.Number Field.sum}}/{{Issuecount}}
a. Here Number Field is my Custom field name
b. {{Issuecount}} is variable I created in step 2
This should work to Calculate Average
Hi @Akhand Pratap Singh ,
Thanks for your answer, a change is I am in data centre environment and somehow I am not linking PE with Epic as parent child directly, instead I am just using link issue with link type "is child task of" for Epic.
So Epic appears as "is child task of" PE.
Could you please let me know how can I put write query for fetching those Epic?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if you are on JIRA Cloud then to get the average of a field below will work. The result can be saved in a variable say varEpicBAverage
{{lookupIssues.customfield_xxxx.asNumber.average|0}}
asNumber takes a string and converts it to a number (if possible)
For testing, you can define lookup action with a manual trigger as
parent = {{ issue.key }} or parent = {{ triggerIssue.key }}
and then execute the rule for PE.
With lookup the focus has shifted to Epics, so you can branch to parent
Then add an action of Edit to update PE field of A using smart value varEpicBAverage.
Let me know if this works for you
Note: on JIRA DC version as far as I understand lookupIssues does not support all custom field
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.