简体   繁体   English

JIRA内置脚本侦听器-创建一个子任务。 -如何设置受让人?

[英]JIRA Builtin Script Listener - Create a sub-task. - How to set assignee?

I am using JIRA Builtin Script Listener - Create a sub-task. 我正在使用JIRA内置脚本侦听器 -创建一个子任务。 to create subtasks for Dev and QA for every story and bug in JIRA. 为JIRA中的每个故事和错误为Dev和QA创建子任务。

I would like the subtasks to be always assigned to user "Virtual QA". 我希望将子任务始终分配给用户“虚拟QA”。 It seems that I have to do this through Additional issue actions field. 看来我必须通过“ 其他问题操作”字段来执行此操作 I am trying to use: 我正在尝试使用:

issue.summary = ('QA: ' + issue.summary)
issue.assignee = 'Virtual QA'

This works only if I use only the first line to set the subtask summary but when I add the second line the script does not run. 仅当我仅使用第一行来设置子任务摘要时,此方法才有效,但是当我添加第二行时,脚本不会运行。 Can you please help me to solve it? 你能帮我解决吗?

I was not able to help myself using the official documentation on: https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts 我无法使用以下官方文档来帮助自己: https : //jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts

您需要传递用户对象而不是字符串,这里是同样的问题https://answers.atlassian.com/questions/66562/set-assignee-to-some-specific-user-in-post-function-script

After a lot of investigation and a hundred text tickets this works :) 经过大量调查和一百张文本票证,该作品:)

import com.atlassian.jira.component.ComponentAccessor
issue.summary = ('QA: ' + issue.summary)
issue.setAssignee(ComponentAccessor.getUserUtil().getUser('qa'))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM