You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello,
i try to insert Value to UserPicker FIeld from another TextField. I try:
def onBehalf = customFieldManager.getCustomFieldObject(28311)
def requestParticipants = customFieldManager.getCustomFieldObject(18130)
def givenValue = issue.getCustomFieldValue(onBehalf) as String
def notNull = givenValue != null
if(notNull){
issue.setCustomFieldValue(requestParticipants, givenValue)
}
I don't have any errors here, but it doesn;t work and in logs i have:
Time (on server): Thu Jun 11 2020 11:41:03 GMT+0300 (Moscow Standard Time)
The following log information was produced by this execution. Use statements like:log.info("...") to record logging information.
2020-06-11 10:41:03,482 ERROR [workflow.AbstractScriptWorkflowFunction]: ************************************************************************************* 2020-06-11 10:41:03,482 ERROR [workflow.AbstractScriptWorkflowFunction]: Script function failed on issue: null, actionId: 1, file: null groovy.lang.MissingPropertyException: No such property: customFieldManager for class: Script194 at Script194.run(Script194.groovy:1)
I just want to make sure I understand correctly. You are trying to get the value of a TextField and inserting it into a UserPickerField?
When and where are you trying to do this?
I have solved it by myself. It's post function
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
def onBehalf = ComponentAccessor.customFieldManager.getCustomFieldObject(Field_ID)
def requestParticipants = ComponentAccessor.customFieldManager.getCustomFieldObject(Field_ID)
def givenValue = issue.getCustomFieldValue(onBehalf)
if(givenValue!= null){
def changeHolder = new DefaultIssueChangeHolder()
requestParticipants.updateValue(null, issue, new ModifiedValue(requestParticipants, givenValue),changeHolder)
}
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.