How to call a post function (copy issue) in a groovy script ?

I’d like to call in a groovy script

this Post function : Copy Issue Function

With Params :

· Project : Project1

· IssueType : BUG

· Issue link type : Pre-requisite

· issueReporter : _original.

· Copy Subtasks=false

· Copy Attachments=true

· Copy Comments=true

· Copy Time Trackings=false

(In fact Project1 and BUG are calculated, this is why I cann't use the copy function directly).

How can I do that ?

Thank you for your help.

3 answers

1 accepted

0 vote

It's similar to this gist: https://gist.github.com/jechlin/7198215

Look at the source in the jar to see the parameter names. You don't need a new thread though.

Hello,

Thank you.

I'm in Jira 6.2, with Script Runner (Version:2.1.17).

Which jar (where) and which source ?

Thx

the script runner jar, you can download it from marketplace. You will find a class in there called CloneIssue.groovy

Ok, I've found your scripts.

I've found the first 3 parmeters :

  • FIELD_TARGET_PROJECT: Project
  • FIELD_TARGET_ISSUE_TYPE : IssueType
  • FIELD_LINK_TYPE : Issue link type

But it's not clear for those parameters :

  • issueReporter : _original.
  • Copy Subtasks=false
  • Copy Attachments=true
  • Copy Comments=true
  • Copy Time Trackings=false

I suppose I have to use that, but I really don't understand how ?

ConditionUtils.processCondition(params[ConditionUtils.FIELD_CONDITION]

Thank for your support.

Br,

Michel Katz

0 vote

I don't recognise those others... I certainly would not have called anything "copy time trackings".

The first three is all you need IIRC.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published yesterday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

39 views 0 3
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