Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

I would like to have an option to auto create an issue based of off some fields from another issue

Lorie Sauriol
Contributor
July 11, 2011

I am looking for suggestions on how I could achieve the following:

I have one issue of type feature and I would like to have a button or some option the user could click to auto create another issue (of type backlog) that will prepopulate common fields from the feature issue. Sort of like the Clone option but I the two issues will have many fields that should not be the same and they are actually of differet issue types. This is an optional operation I want to make available to users to make their job eaiser. Typically they will have to make serveral backlog items for every feature and they would use this to auto fill all the common fields.

Is there a plugin or something that already exists that I can use.

I am aware or wget and curl options I can use to prepolulate and create and issue. I am not sure if this is the best way or how I would invoke this command from the main feature issue.

http://confluence.atlassian.com/display/JIRACOM/Automating+JIRA+operations+via+wget

Any suggestions are appreciated.

Thanks,

Lorie

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

4 votes
Answer accepted
muschol
Contributor
July 11, 2011

I can't think of a simple way of doing this without writing your own plugin.

In fact, we have done something similar for a client in the past with a bespoke plugin. The principle is as follows:-

  • You write a plugin that provides a post-function that can be attached to a workflow transition.
  • Customise your workflow and create a transition that does not change the state of the issue (e.g. a transition from Open to Open).
  • Attach your post function to the new workflow transition.
  • In your Java code for the post function, you can use the Jira API to create a new issue of the correct type (i.e. backlog, in your case) and copy the relevant fields across from the original issue.

From a user's point of view, you create the new issue by selecting the new transition from the Workflow menu, which causes the post-function to fire and create the new issue based on the current issue. If any user input is required for this process, you can have a screen with a custom velocity view in between.

Lorie Sauriol
Contributor
July 12, 2011

Thanks a lot.. I like the suggestion of adding it into a workflow transition, I didn't' think of that.

2 votes
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.
July 11, 2011

It sounds like you want to pre-populate the values from a new issue but not commit it (thus giving the user the chance to override the values)?

If you wanted to commit it I would do as Matt suggests, ie a stateN->stateN action with a post-function to clone an issue from the script runner plugin.

If you don't want to commit I would generate a link to the createissue!init.jspa page from a velocity custom field for view. All the information about the issue will be available in the velocity context so you can manufacture a url with as many or few fields as you need.

Lorie Sauriol
Contributor
July 12, 2011

Thanks Jamie! You have answered so many of my questions on this forum and others. I will try this out to see how it works for me and also keep it in mind for future changes I will have to make

1 vote
Bob Swift (personal)
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.
July 12, 2011

JIRA Clone-Plus plugin allows you to clone the issue to a new project or issue type and edit the fields before creation. There are some customization options available to make it more specialized for your specific needs with a little more effort.

Lorie Sauriol
Contributor
July 12, 2011

Thanks Bob, I am just testing your plugin right now. Looks good and thanks for all the extra steps you provided on how to customize it. Awesome.

1 vote
Matt Bates
Contributor
July 12, 2011

I currently do this using JSS. Much as Matt Muschol described but instead of writing a plugin you just have to write a little python script for the postfunction. There's a very good example of the postfunction here. I gather extra arguments using a screen which writes to some temporary fields.

This even works from Bulk Update so you can create clones for multiple tickets (using the same arguments) all at once.

Lorie Sauriol
Contributor
July 12, 2011

Thanks Matt for the information and link. As a newbie I can use all the good examples I can find. I would like to select your response as answering my question too but this page would only let me select three.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events