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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,472
Community Members
 
Community Events
176
Community Groups

Where can I find the documentation for com.onresolve.scriptrunner.canned.jira.workflow.postfunctions

I'm trying to clone an issue using 

com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.CloneIssue

 

void cloneIssue (MutableIssue issue, def parent) {
    def params = [
        issue : issue,
        //(CloneIssue.FIELD_PARENT) : parent,
        (CloneIssue.FIELD_SELECTED_FIELDS) : null, //clone all the fields
    ] as Map<String, Object>
    new CloneIssue().doScript(params)
}

But I cannot for the love of god find where the properties are documented. I need to change the parent of the issue when cloning.

 

Thank you

2 answers

1 accepted

0 votes
Answer accepted

There is no public documentation for this, but all their canned scripts pretty much follow the same template. The doscript params is a map of FIELD : value.

You can get the list of fields using the scriptrunner console's autocomplete.

2020-05-27 14_16_02-Window.png

To answer your other question, I've never seen a cloning feature in jira (built-in or add on) that copied the full history. But in theory, but you can use:

The rub is that I don't see how you can set the date/time of the change history. Each changegroup you create would have a new timestamp.
That's probably why, generally, cloned issues preserve a link to the issue they were cloned from so one could follow the clone link and consult the history there.

Thanks for the response. I'm just going to roll with no history for now. I've never seen autocomplete in the script console. Do I need to enable it or something? Thanks again.

It's enabled by default in newer versions.

Usually, after upgrading, the console will have a large announcement panel that shows he shortcuts.

You can find the details here: https://scriptrunner.adaptavist.com/latest/jira/code-editor.html

So I actually solved this issue but I've ran into another. So CloneIssue does not copy the history of the original issue. Is there anyway to add this?

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events