Forums

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

Not able to get status of linked issue

Thuan M. Tu
October 26, 2018

I'm using the below script in Scriptrunner and it's working just fine for most issues (using OutwardLinks).  However, when the issue is linked FROM the status I want, it returns null.  For example, issue A is blocked by issue B, and the "Linked Status" field shows the status of issue B as expected.  But when issue B blocks issue A, the "Linked Status" field in issue A shows null.

Conversely, I can go to issue B, and the "Linked Status" field shows the status of issue A just fine.  I've tried "InwardLinks", but that only shows the "Linked Status" field in issue A as it's own status. Any assistance would be appreciated. Thanks!

 

Issue A = DCMM-5838

2018-10-26 16_26_35-Script Fields.png

Issue B = ITGOV-36

2018-10-26 16_15_10-Script Fields.png

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
2 votes
Answer accepted
Jia Jie
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 Champions.
March 17, 2021

Hi @Celeste D_Alessandro ,

You'll need to get the Priority field value for the if-else condition. For example:

import com.atlassian.jira.issue.priority.Priority
import com.atlassian.jira.issue.IssueConstantImpl

def priority = getFieldById(getFieldChanged())
def selectedPriority = ((IssueConstantImpl) priority.getValue()).getName()

def justificacion = getFieldById("customfieldid_15801")

if (selectedPriority == "High") {
    justificacion.setRequired(true)

}else {
   justificacion.setRequired(false)
}
TAGS
AUG Leaders

Atlassian Community Events