简体   繁体   English

Jira:如何设置Assignee以匹配父级的自定义字段值

[英]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.

相关问题 如何使用Jira Script Runner设置受让人? - How to set assignee with Jira Script Runner? JIRA内置脚本侦听器-创建一个子任务。 -如何设置受让人? - JIRA Builtin Script Listener - Create a sub-task. - How to set assignee? Jira-后功能可根据问题的自定义字段值多次克隆问题 - Jira - Post-function to clone an issue multiple times based on issue's custom field value 使用“ Jira脚本运行器”自定义侦听器更新自定义字段值 - Update Custom Field Value using a “Scriptrunner for Jira” Custom Listener Jira Scriptrunner - 修改子字段时更新父字段 - Jira Scriptrunner - Update a parent's field when modifying the child's field Jira scriptrunner脚本字段:在自定义字段上,计算其他自定义字段的值并显示总计 - Jira scriptrunner script field: on a custom field, calculate value of other custom fields and display total Jira Server 8.5.8 - Wiki Style Renderer 自定义字段 - 使用 Behavior Initialiser 设置默认表 - Jira Server 8.5.8 - Wiki Style Renderer custom field - Set default table using Behaviour Initialiser 如果自定义字段值小于 1,则使用 Groovy 阻止 Jira 开票 - Block Jira opening ticket if custom field value is less than 1 using Groovy 使用groovy脚本设置Jira组件字段 - Set Jira component field using groovy script 发布功能脚本:自定义字段的设置值 - Post Function Script: Set Value of Custom Field
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM