Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to clone an issue using Script rest Endpoints without passing a json file

Vineela Durbha
Contributor
May 16, 2019

I am new to this Script Rest endpoints and i am looking for on a sample script on how we can create/clone an issue using this Rest end points.

Can anyone help me or guide me on this

 

Thanks

1 answer

1 accepted

0 votes
Answer accepted
Alex Gallien
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 16, 2019

Adaptavist has a guide on this with some good examples: ScriptRunner - REST Endpoints.

Combine that with the code in Create an issue in Jira - Adaptavist Library and you'll have the starting points for learning how to create an issue via a scripted REST endpoint.

Vineela Durbha
Contributor
May 16, 2019

How do we pass multiple customfield parameters while creating the issue?

Alex Gallien
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 17, 2019

Going off that example, you'd use:

issue.setCustomFieldValue(CustomField customField, Object value)

for each of your custom fields you want to set. The object defined in

def issue = issueFactory.issue

is a MutableIssue object, so  to find all the methods on that object, see this doc: https://docs.atlassian.com/software/jira/docs/api/7.1.9/com/atlassian/jira/issue/MutableIssue.html

Suggest an answer

Log in or Sign up to answer