with JIRA REST Java Client Library, how to update issues by deleting values of fields Edited

I use JIRA REST Java Client Library 4.0.0.
https://ecosystem.atlassian.net/wiki/spaces/JRJC/overview

I want to update issues by deleting values of duedate and the following types of customfields with it.
・datepicker
・datetime
・userpicker
・float
・select list
・cascadingselect
・radiobuttons

Could you show me how to update issues by deleting values of these with JIRA REST Java Client Library?

The following is my source code. It can't update issues by deleting values.

JiraRestClientFactory jrcf = new AsynchronousJiraRestClientFactory();
JiraRestClient jrc = jrcf.createWithBasicHttpAuthentication(new URI([JIRAURL]), [USERID], [PASSWORD]);
IssueRestClient irc = jrc.getIssueClient();

Map<String, FieldInput> valMap = new HashMap<String, FieldInput>();
valMap.put("duedate", new FieldInput("duedate", null));
valMap.put("customfield_[CUSTOMFIELDID]", new FieldInput("customfield_[CUSTOMFIELDID]", null));

IssueInput ii = new IssueInput(valMap);
irc.updateIssue("[ISSUEKEY]", ii).claim();

1 answer

0 votes

Hi Runa,

There is a Suggestion titled Add, edit, or delete custom fields in REST API that provides a third party add-on which may be of use:

It would be nice to be able to deal with custom fields using Jira REST API.

At the moment, it's possible to get some info by retrieving editmeta :

 http://example.com:8080/jira/rest/api/2/issue/{issueIdOrKey}/editmeta

But you cannot add, edit, or delete custom fields via JIRA REST API (as you can in the admin section).

Workaround

The third party plugin Jira Customfield Editor provides REST endpoints for the CRUD operations on custom fields.

Please take a look at the Suggestion and vote on JRASERVER-28539 or JRACLOUD-28539 depending on whether you are using Server or Cloud to provide impact and be notified of any changes to the ticket.

Cheers,

Branden

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,366 views 15 19
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