"Easy Revise" Transition - Clone Issue with User Input

C_S_ July 9, 2021

Hello,
I have the following idea want to achieve:

We have an issuetype "Document" where we want a have a fast and easy way to create a "revision" of the same document and have the option to change a few fields on the clone (Due date, Assignee, ...)

My plan so far:
Have a Transition called "Revise" that goes from any status to itself (or maybe just from Done to Done because you shouldn't be able to revise a Document that is not done, makes no sense to me at least).

That Transition should create a clone of the issue and - here is my problem - give the user the option to directly edit the newly created issue while leaving the old one untouched.

I can easily clone and link the issue using Scriptrunners already existing post-function for it, no problem here.

Problem is, when adding a screen to the Transition and adding the fields on the screen to have as input for the user, it will update the original issue, not the clone.

Ideas I had:
1.
Maybe it is possible to open the edit issue screen from the post-function? I could maybe use the doAfterCreate callback for that and instead of having a screen on the original issues transition, just directly edit the new one?
Or is there a way to have user input during a post function

2.
Mabye I can store the old values of the original issue somewhere, then use the transition screen to update the issue, then trigger the clone and link post function, and then restore the original values to the old issue?

3.
Maybe a Behaviour or Listener would be able to help me here?
I can fire a custom event on the transition to trigger a listener, but can you open screens from a listener?

Any help would be greatly appreciated.

Thanks!

1 answer

1 accepted

1 vote
Answer accepted
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 9, 2021

Hi C.S.

Just off the top of my head, I am thinking that maybe you create a couple of custom fields that get populated on the transition screen. Then when you clone the new issue, you use some automation to copy over the values from the custom fields into the Due Date, Assignee, etc. 

The custom fields on the original issue can be "hidden" in that they only appear on the transition screen and not the Create/Edit/View screens. 

Would that work? 

C_S_ July 14, 2021

That works, yes.
Thank you!

Is there a way to open the newly created issue instead of returning to the old one?

Like John Funk likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 14, 2021

I am not aware of any way to force a particular issue to pop up or open.  :-(

Suggest an answer

Log in or Sign up to answer