Forums

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

We want to restrict the creation of a particular type of issuetype under an epic based on the value

Priyanka khare
Contributor
September 21, 2020

We want to restrict the creation of a particular type of issuetype under an epic based on the value selected in the custom field of the same epic.
For example- inside an epic i have a select list field called called "Strategic Type" and if i have selected "production" then i should be able to create just the issuetype "story" and if i have selected anything other than "production" then i should be able to create any issuetype except for "story".

 

Is this achievable?

Thanks in advance

1 answer

0 votes
Gustavo Félix
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 22, 2020

Hi @Priyanka khare 
Do you have any plugin?

Priyanka khare
Contributor
September 23, 2020

Yes, automation for jira and scriptrunner  @Gustavo Félix 

Gustavo Félix
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 23, 2020

Ok. If I understood you...
You can create a custom validator to your workflow transition.

e.g.

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import com.opensymphony.workflow.InvalidInputException

def epicLink = customFieldManager.getCustomFieldObjectByName('Epic Link)

def epicField = customFieldManager.getCustomFieldObjectByName("your epic field")
Issue parentEpic = issue.getCustomFieldValue(epicLink) as Issue
if (parentEpic.getCustomFieldValue(epicField) =="production" && issue.issueType.name != "Story"){
throw new InvalidInputException("you have to select story")
}

Suggest an answer

Log in or Sign up to answer