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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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 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