Used Builtin script listener to create sub-task and that part is working fine. Now trying to add a custom field, within automatically created sub-task. Name of the custom field to be CC_List and the value to be xyz@abc.com.
I followed Kostas' response at https://answers.atlassian.com/questions/196852/script-runner-create-subtask-built-in-script-postfunction
Used the following call, to get the custom field object
def cf = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'CC_List'}
at this point, used "addCustomFieldValue" method and that did not work.
any suggestions please ? Not sure how to proceed
Jamie - thanks for looking into my request. We are using JIRA 6.1.7
CC_List is a custom field and type : UserPicker (multiple users).
Am I facing the problem, since it is not a text field ? thanks
Yes, the type of the field is not irrelevant here. You need to set it to a collection of User objects, or ApplicationUser, can't remember which.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am running into a similar problem where I can't set the value either. My field is a single select list type, and oddly enough I can have the field inherit the value from the parent, but I can't seem to set it to a different value.
How/where would you specify the type of field? When I use the code below, the sub-task fails to create, however if I follow the template for copying the value from the parent, the sub-task creates and inherits the value properly.
def cf = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'CustomFieldName'} issue.setCustomFieldValue(cf, 'my value')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you just the right label, the right people will see this... that's generally more effective than sending me mail.
Using the built example worked for me:
def cf = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'TextFieldB'} issue.setCustomFieldValue(cf, 'my value')
but that's for a text field. What type of field is CC_List?
What versions are you using?
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.