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

Accepted Answer
0 votes

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 votes

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
Community showcase
Posted Oct 11, 2018 in Marketplace Apps

You + one app + a desert island...

Hi all! My name is Miles and I work on the Marketplace team. We’re looking for better ways to recommend and suggest apps that are truly crowd favorites, so of course we wanted to poll the Community. ...

2,958 views 5 6
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