Setting Custom Fields in Jira

Megha K Y October 24, 2013

Can anyone help me with java code for setting the values to the custom fields in jira and also checking the custom field is of cascade select type and also how to set values for custom field of cascade select type for jira 5.2.5. ?

3 answers

0 votes
Makarand Keer November 22, 2013

We are having JIRA 3.* version, can anybody send me sample code for update issue?

I can create issue using RemoteCustomFieldValue and setting key value, however updateIssue method accepts only RemoteFieldValue and this type does not support key property.

Thanks

Makarand

0 votes
Megha K Y October 24, 2013

Thank you so much.

i will try out this

0 votes
Bharadwaj Jannu
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.
October 24, 2013
Megha K Y October 24, 2013

Thank you for the quick response.

But when i wrote the foloowing code to check whether the custom field is of type cascade select field i'm the getting the error at line :

if (customField.getCustomFieldType() instanceof CascadingSelectCFType)

it is not recognizing the "CascadingSelectCFType" keyword.

here is the code :

CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
Collection<CustomField> issueCustomFields = customFieldManager.getCustomFieldObjects(issue);

for (CustomField customField : issueCustomFields) {
if (customField.getCustomFieldType() instanceof CascadingSelectCFType) {
//if(isCascadingSelect(customField)){
addCascadingSelectCustomFieldValueToIssueInputParameters(issueInputParameters,
issue,
customField);

continue;
}

This code is written for jira 5.2.5.

Bharadwaj Jannu
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.
October 24, 2013

you try explicitely for CascadingSelectCFType customfield and check

CustomField casCF = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("<your casading select field>");

if(casCF!=null)

{

<...>

}

For reference you check https://confluence.atlassian.com/pages/viewpage.action?pageId=163414052

Suggest an answer

Log in or Sign up to answer