Get custom field value after creation

Mamikon Papikyan January 11, 2021

Hi Atlassian,

I want to get custom field value after issue creation. Here is my code where I'm setting value to custom field:

 void set_custom_field_value(String value, String destField, Issue issue)
{
CustomFieldManager cm = ComponentAccessor.getCustomFieldManager();
CustomField f = cm.getCustomFieldObjectByName(destField);
DefaultIssueChangeHolder ch = new DefaultIssueChangeHolder();
f.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(f),
value), ch);
}

This works and I can see value in the custom field, but I couldn't get it from Rest API. It gave me null.

This works in jira 7.x perfectly, I can get the custom field value.

Sorry for bad English :).

Regards,

Mamikon

 

1 answer

0 votes
mogavenasan
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.
January 15, 2021

Hi @Mamikon Papikyan,

REST API endpoint for Jira Server and Jira Cloud is different. Can I know how you are getting the custom field value using REST API?

Thanks,
Moga

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events