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

Runa I'm New Here Jan 21, 2018
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 vote

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

42 views 0 4
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