Hello. I created a script that appends a user list to the existing values in a custom field.
The custom field is a User Picker (multiple users).
I ran it on Scriptrunner > Jobs > escalation service with these conditions and works well.
My question is this : How can I make it update the custom field values while not actually updating the issue itself? This is becuase when a issue is updated, too many notifications will be sent through the slack "Jira Server" App.
Conditions:
Jira server version : 8.10.1
Scriptrunner version : 6.34.0
User : APIUser
JQL Query : Project = Test AND Created > "2023/05/01" AND reporter = jkjang
Code:
import com.atlassian.jira.component.ComponentAccessor
def user_add = ['jkjang','johanne']
def cf = customFieldManager.getCustomFieldObjects(issue).find {it.name == '참조자'}
def existing_user = (List) issue.getCustomFieldValue(cf)
def final_user = existing_user + user_add
def string_final_user = final_user.join(",")
def output = string_final_user.replaceAll(/\([^()]*\)/, "")
issueInputParameters.addCustomFieldValue(cf.id, output)