Dear all,
We have a custom field named for instance List Of BD which is a single select list box. Usually we configure that list with static data directly from the configure section of the field.
Now in our new case, those data are coming from an external source that we have access to which render a list of DB in an array.
What we are looking for is the best way with script runner script to add those value to the list if it is not existing already.
What is the proper way to do this ? sample will help
regards
Thanks for the reply Alejandro. Only an email address, of users already in the JIRA internal directory, would be used.
This thread seems to contain some scripts that may get me there - https://community.atlassian.com/t5/Answers-Developer-Questions/How-do-I-add-a-specific-user-as-a-watcher-using-script-runner/qaq-p/569185
Could anyone please suggest a change to the below script that would allow the use of the user account email address instead of user name?
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.user.ApplicationUser
MutableIssue issue = issue
def cfManager = ComponentAccessor.getCustomFieldManager()
def watcherManager = ComponentAccessor.getWatcherManager()
def cf = cfManager.getCustomFieldObject(“12046”)
def u1 = issue.getCustomFieldValue(cf) as ApplicationUser
watcherManager.startWatching(u1, issue)
Please note, I'm getting an error when running the above script but seems to be close to what I would require.
Any assistance appreciated.
Cheers,
Andrew
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.