Scriptrunner Summary and Description are empty

pejsbeaudet April 7, 2021

Hello everyone!

I am currently working on a Post Function after the transition of a Service Desk ticket.

When the transition happens, i have a script creating a new Issue in another project. It is the same issue type. The issue is created and the custom fields filled in the service desk are copied in the new issue.

However, the summary and description fields do not work.

The problem is issue.summary is null and issue.description is null.

post("/rest/api/2/issue")
.header("Content-Type", "application/json")
.body(
[
fields: [
summary : issue.summary,
description: issue.description
]
])
.asString()

 I have removed the other fields since they were working, to lighten the code.

Is there a reason why they are empty when I see them in the Service Desk?

 

2 answers

1 accepted

1 vote
Answer accepted
pejsbeaudet April 9, 2021

Found my problem. 

The information is in issue.fields.summary and issue.fields.description

0 votes
Tori Black April 7, 2021

If the issue is already created and you change the issue object after that, you have to update the issue manually. mylonestar

pejsbeaudet April 7, 2021

Maybe I was unclear. 

The Service Desk issue already exists, and when I transition it, I have a script to create a new issue in another project. The 'issue' instance refers to the Service Desk issue, and the summary and description fields are null.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events