2017-09-29 9 views

答えて

2

ScriptRunnerのような追加のプラグインなしでこれを行うことはできません。 JQL does not even support to query a parent of an issue。 SRでは、 "issue created"のようなイベントのリスナーを実装し、Groovyスクリプトを実行することができます。問題を作成したリスナーは、次のように見えます。

import com.atlassian.jira.component.ComponentAccessor; 
import com.atlassian.jira.issue.CustomFieldManager; 
import com.atlassian.jira.issue.fields.CustomField; 
import com.atlassian.jira.issue.Issue; 
import com.atlassian.jira.issue.MutableIssue; 
import com.atlassian.jira.issue.IssueManager; 
import com.atlassian.jira.bc.issue.IssueService 

CustomFieldManager customFieldManager = 
    ComponentAccessor.getCustomFieldManager(); 
IssueManager issueManager = ComponentAccessor.getIssueManager(); 
IssueService issueService = ComponentAccessor.getComponent(IssueService); 
CustomField epicLinkField = 
    customFieldManager.getCustomFieldObjectByName('Epic Link'); 


//lookup the corresponding epic via the subtask's parent 
MutableIssue epic = issueManager.getIssueObject(
    (String)issue.getParentObject().getCustomFieldValue(epicLinkField) 
); 

//assign subtask to the assignee of the epic 
def validateAssignResult = issueService.validateAssign(epic.getAssignee(), 
    issue.id, epic.getAssigneeId()); 
issueService.assign(epic.getAssignee(), validateAssignResult) 
1

いくつかのオプションがあります。 mdoがすでに答えているので、スクリプトランナーもその一人です。

グロビスクリプトを書きたくない場合は、Jira Misc Workflow Extensionsプラグインをご覧ください。これには、Epicまたは親の問題からのフィールドのコピーをサポートする「リンクされた問題からフィールドをコピーする」というpost関数が含まれています。資料はhereです。

related question on the Atlassian Communityには、他にもいくつか役立つプラグインが記載されています。

関連する問題