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

This widget could not be displayed.

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
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

173 views 1 3
Join discussion

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