Query Issue custom field can't return correct value unless issue is opened in browser

jane chen January 18, 2020

Here's the scenario:

1. I've setup a "Linking issue" custom filed with "query issue come filed" and setup the JQL to fill in the issue in this field. this custom field is named "father_project"

2. I use scriptrunner to set value to this custom field to one issue like this

FatherProjectCustomField.updateValue(null, childTicketIssue, new ModifiedValue(childTicketIssue.getCustomFieldValue(FatherProjectCustomField),FatherProjectIssue.getKey() ), new DefaultIssueChangeHolder())

3. I search issue in JIRA with "father_project = xxx", it return null

4. I open child issue, and check the value in father_project filed, the issue key is correct

5. then I searched issue in JIRA again with "father_project = xxx", it return the child key

it seems that when the code write the value, but JIRA doesn't recognize it until the child issue is open in browser.

It look strange, and I want to find a way to write this custom field value correctly, so that I can get the query result directly in code without opening the child issue on browser UI.

1 answer

1 accepted

0 votes
Answer accepted
jane chen January 18, 2020

I fixed this issue by using ScriptRunner issue picker instead of query issue custom field

Veera
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 18, 2020

Glad to know that you were able to figure it out and fix the issue. Thanks for sharing @jane chen .

jane chen January 18, 2020

Thanks for your attention. I just can't understand what happened to the custom field and had to find alternative way. :)

Suggest an answer

Log in or Sign up to answer