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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How Can I set value of custom field from plugin

I have tried below code, it gives me exception.

Issue issue = issueEvent.getIssue();
CustomField customField = customFieldManager.getCustomFieldObject("customfield_12200");
ModifiedValue mVal = new ModifiedValue(issue.getCustomFieldValue(customField), issueEvent.getIssue().getAssignee());
customField.updateValue(null, issue, mVal, new DefaultIssueChangeHolder());

 

It throws exception in 

public void createValue(CustomField field, Issue issue, @Nonnull T value) {
this.customFieldValuePersister.createValues(field, issue.getId(), this.getDatabaseType(), Lists.newArrayList(new Object[]{this.getDbValueFromObject(value)}));
}

 

1 answer

Hi Aayush Mohanka and welcome,

Do you mind to share with us the whole stacktrace of the error to see if anyone here can help you with your problem?

Usually, errors when setting up a new value within a field are caused by permission issues (i,e. the field isnt editable at all or the user who is performing the action hasn't the necessary permission for do that) or either you are setting up an incorrect value type on that fields (i,e, the field expects an ApplicationUser.class but you are updating the field with just the username property which is an String.class or things like that)

Best Regards

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
Community showcase
Posted in Jira Software

Presenting the "Best of 2020" Jira Software roundup!

Catch up with Atlassian Product Managers in our 2020 Demo Den round-up! From Advanced Roadmaps to Code in Jira to Next-Gen Workflows, check out the videos below to help up-level your work in the new ...

7,139 views 8 28
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you