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

This widget could not be displayed.

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

This widget could not be displayed.

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

The first three is all you need IIRC.

This widget could not be displayed.

Thx.

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
Published Jul 25, 2018 in Marketplace Apps

Jira Cloud and Bitbucket Cloud Integration with Microsoft Teams

One of the newest products in the Microsoft family - Microsoft Teams,  is a chat-based hub for teamwork that integrates all the people, content, and tools your team needs to be more engaged and ...

733 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