You'll need an addon that provides such a post-function, or one of the scripting options like Script runner.
Once you've decided which route to take there, then we can probably help you (although it's "get user, put user in field" really)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Script runner. Always. (I'd have said that before either Jamie or I joined Atlassian, it's the one I've always turned to when something "clever" is needed)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have Script Runner installed, I'm still new to Jira, could you provide sample code. I'm looking to set user picker custom field to a specific user.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry Aron, missed the email update. I just rummage through Jamie's docs for examples - https://jamieechlin.atlassian.net/wiki/display/GRV/Script+Runner https://jamieechlin.atlassian.net/wiki/display/GRV/Post+Functions+With+Comments might be a good start though, as it's got custom field code and some stuff around users.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Was trying the script below and it does not work, following is the error from the log file.
java.lang.ClassCastException: java.lang.String cannot be cast to com.atlassian.jira.user.ApplicationUser at com.atlassian.jira.issue.customfields.impl.UserCFType.getDbValueFromObject(UserCFType.java:79) at com.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType.createValue(AbstractSingleFieldType.java:161) at com.atlassian.jira.issue.fields.CustomFieldImpl.createValue(CustomFieldImpl.java:831) at com.atlassian.jira.issue.fields.CustomFieldImpl.updateValue(CustomFieldImpl.java:505) at com.atlassian.jira.issue.fields.CustomFieldImpl.updateValue(CustomFieldImpl.java:487) at com.atlassian.jira.issue.fields.OrderableField$updateValue.call(Unknown Source) at Script5.run(Script5.groovy:22)
import org.apache.log4j.Category import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.ComponentManager import com.atlassian.jira.issue.fields.CustomField import com.atlassian.jira.issue.ModifiedValue import com.atlassian.jira.issue.util.DefaultIssueChangeHolder import com.atlassian.jira.issue.util.IssueChangeHolder log = Category.getInstance("com.onresolve.jira.groovy.CopyRegEx") // Enter parameters here // The example converts a reporter, which in my case has the format: Echlin, Jamie: DEPT (LOC), to Jamie Echlin - LOC. def targetFieldName = "customfield_11103" ComponentManager componentManager = ComponentManager.getInstance() CustomFieldManager customFieldManager = componentManager.getCustomFieldManager() CustomField customFieldTarget = customFieldManager.getCustomFieldObject(targetFieldName) def sourceVal = "mosheeh" IssueChangeHolder changeHolder = new DefaultIssueChangeHolder(); customFieldTarget.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(customFieldTarget), sourceVal), changeHolder)
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.