How to prevent linking issues to epics that are closed?

Iro Karavasili November 12, 2020

Hello all,

I'd like to prevent linking issues to epics that are closed (Epics in status Done for example).
I saw in another post that it is probably possible using a ScriptRunner behavior:

It is possible to define a behaviour which you can attach to the Epic Link field. This behaviour code can look up the status of the selected issue, and if the status is Done then setError on the Epic Link field which would then prevent the user submitting the issue until they choose a different Epic.

The Epic Link field returns a String value like this: "key:SSPA-30" which you can then remove the word "key:" from and use the remaining string with the issueManager.getIssueByCurrentKey(String key) method to get the issue object. Then you can get the status.name from that issue object to check if it equals "Done".

Could someone familiar with ScriptRunner behaviors help?

Thank you!

 

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.9.2
TAGS
AUG Leaders

Atlassian Community Events