Forums

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

How to make link issue type required based on selected resolution value

John Diz November 1, 2019

I tried with behaviours from script runner but no luck :-(

 

2 answers

1 accepted

1 vote
Answer accepted
Avinash Bhagawati {Appfire}
Community Champion
November 1, 2019

Hi @John Diz ,

Can you please try below script for Resolution field in behaviours.

import com.atlassian.jira.issue.resolution.Resolution

def resolutionField = getFieldById("resolution")
def issueLinkType = getFieldById("issuelinks-linktype")
def issueLinkIssue = getFieldById("issuelinks-issues")


def resolution = resolutionField.getValue() as Resolution

if (resolution.name == "Issue Created") {
    issueLinkType.setHidden(false)
    issueLinkType.setRequired(true)
    getFieldById("issuelinks-linktype").setFormValue("relates to") 
    getFieldById('issuelinks-linktype').setReadOnly(true)
    issueLinkIssue.setRequired(true)

       
} else {
    issueLinkType.setRequired(false)
    issueLinkType.setHidden(true)
}

Thanks,

Avinash 

0 votes
Srinivasa Chimata
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 8, 2022

The snippet works fine, but it doesn't stop you from submitting on the Resolve screen without the Issue ID!! How can we ensure that the issue ID is entered???

Suggest an answer

Log in or Sign up to answer