Forums

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

How to get list of Linked issue keys based linked issue custom field value?

Xoom Atlassian Administrator July 11, 2018

I am trying to get it for a linked issue which should check for a custom field "radio button" yes or no. if yes, the linked issue should have a custom text field filled. If it is empty, my validator should through error. 

 

I tried this script from another answer, which partially works 

{code}

import com.atlassian.jira.component.ComponentAccessor

def customFieldManager = ComponentAccessor.getCustomFieldManager()

def subTasks = issue.getSubTaskObjects()

def childCfValue

if (issue.issueType.name == "Bug") {

    issueLinkManager.getOutwardLinks(issue.id).first() { issueLink -> // go through all issues linked off of the Story

        def linkedIssue = issueLink.getDestinationObject()

        def customField = customFieldManager.getCustomFieldObjectByName("customfield_xxxx")

        return linkedIssue.getCustomFieldValue(customField)

    }

}

 

 

 

 

if (subTasks) {

    issue.getSubTaskObjects().each { subtask -> // go through sub-task issues

        def customField = customFieldManager.getCustomFieldObject("customfield_12220")

        childCfValue = subtask.getCustomFieldValue(customField)

    }

}

 

{code}

 

-Sumedh 

0 answers

Suggest an answer

Log in or Sign up to answer