Forums

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

Add value of fact to a new issue on closing

Philipp Tauber July 12, 2018

Is there a possibility to add the value of a field to a new issue on closing?

 

What I want to do:

Issue hat estimated time of 40h

38h are used up on closing issue

=> I want add the 2 remaining hours to an issue called ~"remaining hours" where all remaining hours of closed issues are store in one field.

So if remaining hours is 7 and i close the issue the field should say 9.

 

We have installed scriptrunner and jira misc custom fields so I'm sure there is a possiblity.

1 answer

1 vote
David Fischer
Community Champion
July 12, 2018

Hi Philipp,

jira misc custom fields (JMCF) won't help you much here but jira misc workflow extensions (JMWE) might. You could use a Scripted (Groovy) post-function on your Close transition with a very simple script to change the Remaining Hours field of your "Remaining Hours" issue (which you could probably specify by issue key since there's only one).

If you have JMWE for Jira Server, let me know and I can help with the script (which is very different from what you'd need for ScriptRunner).

Philipp Tauber July 12, 2018

Hey David,

 

thank you for your answer.

Unfortunately we do not have jira misc workflow extensions installed so that won't work.

Does that mean that scriprunner isn't helping me in this situation either?

David Fischer
Community Champion
July 12, 2018

No, it just means I don't know how to write the code for ScriptRunner ;) JMWE uses simplified APIs but the same results can be achieved using the Jira API on which ScriptRunner relies - it's just more complicated.

I suggest you add the scriptrunner label to your question so that Adaptavist can see the question and answer it.

Suggest an answer

Log in or Sign up to answer