Hi Dear Community,
I had a problem again after the update, now with JSM. After upgrading to version 5.12.10, the script that sets the value of the 'Customer request type' field stopped working correctly.
On some projects, for some reason the field value just stopped being set.
In other cases it is set, but in the task it is displayed as 'No match'. Maybe someone has encountered this problem and knows how to solve it?
![[ES-6494] Test issue 1.png [ES-6494] Test issue 1.png](https://us.v-cdn.net/6038660/uploads/images/336438iB67D7A627091C32F/%5BES-6494%5D%20Test%20issue%201.png)
To set the value, I use:
And if you go to the portal, the request type is set correctly.
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.issue.MutableIssue
def issue = ...
//issue.requestType
def customerReqTypeCF = ComponentAccessor.CustomFieldManager.getCustomFieldObject("customfield_10000")
def key = "es/8513f0d8-16c3-4a36-a41e-73ad733334b2"
def newCustomerReqType = customerReqTypeCF.getCustomFieldType().getSingularObjectFromString(key)
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
customerReqTypeCF.updateValue(null, issue, new ModifiedValue("", newCustomerReqType), new DefaultIssueChangeHolder())
ComponentAccessor.issueManager.updateIssue(user, issue, EventDispatchOption.ISSUE_UPDATED, true)
UPD.
The problem is that when I set the field value manually and then retrieve the field value by scriptrunner, I get the value 'es/8513f0d8-16c3-4a36-a41e-73ad733334b2'. But if I take a value from another task and set it in test task, I get the field value 'engsup/8513f0d8-16c3-4a36-a41e-73ad733334b2'. It turns out that the value is broken because of a project key that was changed earlier.
