Can a script run from opening a sub-task, update the same script field in an unopened Task or Epic?

Derek Allen May 29, 2018

I am fairly new to JIRA and have inherited a system with some scripted fields.   The script looks at an Epic , finds the Tasks associated, then the Sub-tasks then sums the effort progress from each Sub-task to come up with the current progress in the Epic.  The same script run from a Task does similar but comes up with the current progress in the Task.   This is all fine.    However, what we would like to do, is have this field in the Epic and the Task, update whenever the Sub-task is updated so that whenever a dashboard summary of Epics is produced the scripted field for the Epic is correct without having to open each Epic.   So the question is, can a script run from opening a sub-task, update the same script field in an unopened Task or Epic?  Any guidance welcome.

1 answer

0 votes
Krista Parker July 3, 2018

Hi there,

 

What tool are you using for scripted fields? It may be possible.

Derek Allen July 16, 2018

 

Sorry for the late response but this is a side task and other stuff had priority!

I am using the embedded script console in JIRA. 

I have since managed to amend the Epic by finding the Task from the sub-task ( using GetParentObject ) and then the Epic using some code I found:

    def customFieldManager = ComponentAccessor.getCustomFieldManager();
    def epicLink = customFieldManager.getCustomFieldObjectByName('Epic Link');

then I run the original Epic code with the found parent and that seems to work.

Ideally I would like to update the Sub-task, Task and Epic fields all at once but that I guess I would need to return 3 values.   Is that allowed? 

Suggest an answer

Log in or Sign up to answer