How to update a field in issue with Jira rest java client?

Dang Thi Thuy Tien
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.
July 3, 2019

I try to update priority for an issue. I use jrjc version 5.1.0

IssueRestClient issueClient = restClient.getIssueClient();
IssueInput issueInput= ....
issueClient.updateIssue(issueKey,issueInput);

I find the function with have 2 param issueKey and issue.

But I just want to update one field. How can I do that?

Thank you,

 

1 answer

1 accepted

0 votes
Answer accepted
Dang Thi Thuy Tien
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.
July 3, 2019
IssueRestClient issueClient = restClient.getIssueClient();

IssueInputBuilder builder = new IssueInputBuilder();
builder.setPriorityId(priorityChangeId);

IssueInput issueInput= builder.build()
issueClient.updateIssue(issueKey,issueInput);

Just do like this ;)  

Adir D October 29, 2020

@Dang Thi Thuy Tien 

Thanks for your help.

this code uses old code of the API ?

seems there is not existing empty constructor of IssueInputBuilder()
also no such existing method ' updateIssue'

issueClient.updateIssue(issueKey,issueInput);

will be helpful to get reference to some example project from latest version (or close...)

 

Thanks

Suggest an answer

Log in or Sign up to answer