[Script Runner] Clone issue post-functions - passing project and issuetype as parameters.

Is there any possibility to override the default interface of the "Clone issue and links" post-function?

I would like to pass the project and issuetype as parameters in the "additional issue actions".

I have unpacked the script runner plugin and tried to take a peek into the code of the post-function to look for some hints, but I'm afraid I became more confused than I was before :) Not to mention the function itself seems to be scattered in three different files.

Here is an example of my desired use case:

2 answers

1 accepted

This widget could not be displayed.

An approach would be to create as many postfunctions as the combinations of projects and issue types you have.

Well, that's not exactly what I wanted, but for now, as long as I have less than 10 combinations your method does the trick. Thanks!

This widget could not be displayed.

you want something like:

issue.setIssueTypeId(3) ... etc

Ah... I think I maybe understand what you are asking. You should be able to get the selected target project key using:

static import com.onresolve.scriptrunner.canned.jira.utils.AbstractCloneIssue.FIELD_TARGET_PROJECT

params[FIELD_TARGET_PROJECT]

(untested).

Hi Jamie, I want to piggy back on this issue. Hope this is OK? I want the same scenario. Basically this: * When user moves an issue to a status. I will pop up a screen. Here he can select the project to clone this issue to from a custom field. * Once the issue is moved to this status. I want to use your clone and link post function to generate a new issue in same project with "cloned by" links. * I then want to use the "additional actions" to get the selected project and move it to the wanted project. So basically not pre-selecting the project on the post function but allowing the user to select it during transition to status. Is this doable?

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

224 views 3 0
Join discussion

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