Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How set multi-user-select customfield ? (by java soruce)

leejimin1006 September 1, 2012

Hi, I'm JIRA plugin developer.

I want to set multi-user-select customfield by java code.

so, i try.

My source:

String strUserList = "admin, leejimin1006" // sample JIRA ID
MutableIssue issue = issueResult.getIssue();
issue.setCustomFieldValue(customField, strUserList);

But, I unsolved still..

help me, please.

multi-user-select customfield:

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 1, 2012

The custom field value is expecting a list of things you want to set, not a string.

Well, to be more precise, the function is expecting an object. For text fields, that object would be a string, for a select list, it should be an option object, and for multi-selects where you want to set more than one value, it should be a list of options. Additionally, although I'm not 100% sure of this, I think a multi-user-select field would expect a list of user objects, rather than objects.

leejimin1006 September 26, 2012

Hi I resolved.

When Create Issue:

CustomField customField;

MutableIssue issue;

ArrayList<String> userList; // sample IDs

customField.createValue(issue, userList);

When Update Issue:

CustomField customField;

MutableIssue issue;

ArrayList<String> userList; // sample IDs

issue.setCustomFieldValue(customField, userList);

Thank you.

Sameera Shaakunthala [inactive]
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 28, 2014

I'm using JIRA 6.0

Looks like store() method does not work for custom fields. What's the alternative approach?

Sameera Shaakunthala [inactive]
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 28, 2014
TAGS
AUG Leaders

Atlassian Community Events