create issue on trasition

Peter Novak September 12, 2013

Hi :)

I want to create new issue (not subtask) automatically on WF transition. Is there a free plugin to create a new issue of a specific type in a specific project (not the same) and copy fields like summary, description, screenshots and link them together?

Thank you

7 answers

1 accepted

0 votes
Answer accepted
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 17, 2013
Peter Novak September 19, 2013

i tried to use this post function. But when i set different project and different issue type (that doesnt have all custom fields as parent) --- it doesnt work on jira (v6.0.6#6105 :(

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 23, 2013

I will take a look at this shortly.

What should happen is the common subset of custom fields which apply to both source and target get cloned.

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 24, 2013

this was a regression, fixed in latest release: 2.1.14

Peter Novak September 24, 2013

wow it works. however not on my localhost, but on server :) thank you very much :)

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 24, 2013

Maybe your localhost has an old version somehow, or maybe you hacked the script and it's still in your classpath?

Anyway, no problem.

1 vote
RambanamP
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 17, 2013

you can create your own postfunction using jira api and java or you can write postfunction using script runner plugin as @ Udo Brand suggested

1 vote
Peter Van de Voorde
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 12, 2013

Hi Peter,

What you truely need is this plugin :

https://marketplace.atlassian.com/plugins/org.swift.jira.cot

It works like a charm, but it's not free.

Best regards,

Peter

0 votes
Radu Dumitriu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 19, 2013

To have a complete list, let me mention JJupin (paid). However, does much more than a simple add of an issue ....

0 votes
Bharadwaj Jannu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 19, 2013

ComponentAccessor comAcc=new ComponentAccessor();

IssueManager issueManager2 = comAcc.getIssueManager();

ComponentAccessor comAcc=new ComponentAccessor();

IssueManager issueManager2 = comAcc.getIssueManager();

IssueFactory issueFactory2 = comAcc.getIssueFactory();

ProjectManager projManager = comAcc.getProjectManager();

JiraAuthenticationContext authenticationContext2 = comAcc.getJiraAuthenticationContext();

IssueLinkManager issueLinkManager = comAcc.getIssueLinkManager();

MutableIssue issueObject2 = issueFactory2.getIssue();

Project projObj = projManager.getProjectObjByKey("IETTU");// you need to give the project key of the issue you want to create

issueObject2.setProjectId(projObj.getId());

issueObject2.setIssueTypeId("3");// specify the issue type id you want

issueObject2.setReporterId(authenticationContext2.getLoggedInUser().getName());

issueObject2.setSummary("[JIRA-generated] "+issue.getSummary());

issueObject2.setPriorityObject(issue.getPriorityObject());

MutableIssue myissue =issue;

try

{

Issue newTask = issueManager2.createIssueObject(authenticationContext2.getLoggedInUser(), issueObject2);

issue=myissue;

issueLinkManager.createIssueLink(issue.getId(),newTask.getId(),(long)10090,(long)0,authenticationContext2.getLoggedInUser()); //10011->jiraLinkType(Depends)

}

catch(Exception e)

{

e.printStackTrace();

}

}

I customized some of my code which can create a new issue and link with the current issue.

you write this as a workflow postfunction and put in the transition you want.

Peter Novak September 22, 2013

wow thanks. please can you help me with implementing this into jira? should i save this in some file (what file extension? .py ?) I see "Script Post-Function" choice in post functions of transition - and there i can put path to file with script. PLease what are the next steps to use this script you posted? thank you very much

Bharadwaj Jannu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 22, 2013

This code should be written in a workflow postfunction.

https://developer.atlassian.com/display/JIRADEV/Workflow+Plugin+Modules

http://www.j-tricks.com/1/post/2010/08/workflow-post-function.html

the above links will help you to create a postfunction.

then make it as jar with the help of this document and upload the plugin by

Admin->Manage Plugins->Upload .

0 votes
AlaA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 17, 2013

Hey Peter,

You can also use a plugin called Create On Transition . you can have a look at the plugin here:

https://marketplace.atlassian.com/plugins/org.swift.jira.cot

Peter Novak September 17, 2013

no i cant, its paid. and old version creates only subtasks in the same project

0 votes
Udo Brand
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 12, 2013

Suggest an answer

Log in or Sign up to answer