The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How to set jira server ISSUE description with a string variable ?

Rakshit Parashar
July 30, 2021

I am currently reading some data from excel and calling POST method on "rest/api/2/issue/" to create issue with Excel data. However when i am trying to pass a string variable to fields(issue.Fields.Description= str ) . the description does not come up. Error: description cannot be empty

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Kishan Sharma
Community Champion
July 30, 2021

Hi Rakshit, can you share the JSON body you are sending with your request?

Rakshit Parashar
July 30, 2021

 

Hey , I am using this format 

type Issue struct {
Fields struct {
Project struct {
Key string `json:"key"`
}
`json:"project"`
// Parent struct {
// Key string `json:"key"`
// } `json:"parent"`
Summary string `json:"summary"`
Description string `json:"description"`
Issuetype struct {
Name string `json:"name"`
}
`json:"issuetype"`
}
`json:"fields"`
}
Kishan Sharma
Community Champion
July 30, 2021

Thanks, Have you tried a simple JSON body example below -

{
"id": "10000",
"key": "TST-24",
"description": "description",
"self": "http://www.example.com/jira/rest/api/2/issue/10000"
}

May be you can try this first and see if you are getting any errors

Rakshit Parashar
July 31, 2021

Hey , thanks for the reply. I actually made a silly mistake around not using the proper variable assignments. 

Thanks

Kishan Sharma
Community Champion
July 31, 2021

Glad you have worked it out!