create issue on trasition

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

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 :(

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.

this was a regression, fixed in latest release: 2.1.14

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

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

Anyway, no problem.

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

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

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

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

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.

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

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 .

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,903 views 19 22
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you