Forums

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

Script Runner Validator to check field value for "Epic Link"

Ganesh Kumar Vary February 15, 2024

Hi,

In one of our Jira cloud projects, we have multiple type of Epics which is defined by issue type - Epic & dropdown custom field "Epic Type".

The issue type "Story" is supposed to be a child item for only Epics with "Epic Type" - "Story Epic". Similarly, the issue type "Task" is supposed to be a child item for only Epics with Epic Type - "Task Epic".

But we are observing that some users are creating child items under Epics which are not in match with "Epic Type".

We are checking for possibilities to use "Script Runner Validator" in "Story" workflow to check if the Epic Link has "Epic Type" = "Story Epic". But I am getting errors when I am trying to use the script - issue.parentObject.epicType.name == "Story Epic".

Script Runner error.PNG

Can Anybody help me in this please.

Thanks & reagrds,

Ganesh Kumar Vary

1 answer

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
February 22, 2024

Hi @Ganesh Kumar Vary

You could try something like this:-

issue.project.key == "MOCK" 
&& issue.parent.issueType.name.match('^(Epic)$') != null

You will need to change the Project Key and the Issue Type that you want to cross-check according to your requirements. 

Also, I suggest referring to the Jira Cloud Expressions for more information.

Thank you and Kind regards,
Ram

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events