[英]Jira: How to set Assignee to match parent's Custom Field Value
I'm using Jira and the Script Runner plugin to Create a sub-task on transition. 我正在使用Jira和Script Runner插件在转换时创建子任务。 That's all working well. 这一切都运作良好。 However, I cannot seem to set the 'Assignee' of the Subtask to match the value of the 'Project Manager' listed on the parent (I believe this is a custom field). 但是,我似乎无法设置子任务的“受让人”以匹配父项列出的“项目经理”的值(我相信这是一个自定义字段)。 Below is what I am using, But it does not work. 以下是我正在使用的,但它不起作用。 What is the correct way to write this? 写这个的正确方法是什么? : :
issue.assignee = transientVars["originalissueobject"].cfValues['Project Manager']
尝试这个:
issue.assignee= ApplicationUsers.toDirectoryUser(cfValues['Project Manager'])
ACG, I wasn't able to get your answer to work, but I found a very similar script here that worked perfectly! ACG,我无法得到你的工作答案,但我在这里发现了一个非常相似的脚本,完美无缺! Thank you so much for your help! 非常感谢你的帮助!
import com.atlassian.jira.user.ApplicationUsers
cfParent = customFieldManager.getCustomFieldObjectByName('Project Manager')
parentMyFieldValue = transientVars["issue"].getCustomFieldValue(cfParent)
issue.setAssignee(ApplicationUsers.toDirectoryUser(parentMyFieldValue))
For those looking at this answer with a similar problem. 对于那些用类似问题看这个答案的人。 Place this code in the "Additional Issue Action" Box within Script Runner's "Create Subtask" Post Function. 将此代码放在Script Runner的“创建子任务”后期功能中的“附加问题操作”框中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.