Post Function - JIRA 4.4.5 - Unable to set custom field value after upgrade

Now that we have upgraded to JIRA 4.4.5 the post function to update a custom field to a specific value no longer works. Has the formatting changed? I am trying to set the value of the custome field to either Done or Not Done. A workflow exception is being thrown -

2012-05-01 18:59:23,702 http-8080-46 ERROR 1139x73088x2 g9ey2i 192.234.246.206 /secure/WorkflowUIDispatcher.jspa [atlassian.jira.workflow.OSWorkflowManager] Caught exception while attempting to perform action 301 from workflow 131271 on issue 'HSMIS13-37'
com.opensymphony.workflow.WorkflowException: Unable to update custom field 'customfield_10180 - Development Complete' in issue [HSMIS13-37]

1 answer

1 accepted

0 vote
Dieter Community Champion May 01, 2012
Yes, there have been significant changes in select list custom fields. Please read http://confluence.atlassian.com/display/JIRA/Plugin+Developer+Notes+for+JIRA+4.4#PluginDeveloperNotesforJIRA44-Single-andMulti-SelectCustomFieldChanges

E.g. Look at https://answers.atlassian.com/questions/41736/how-to-set-a-new-selectcftype-value-to-a-custom-field how the Option object now necessary in setCustomFieldValue can be retrieved

OK, so I need to use the database ID of the field value I want to set. How do I get the ID?

FYI - I am using a plugin to set the post function, not a script.

Dieter Community Champion May 02, 2012

do you use the Jira Suite Utilities plugin to update the custom field? If yes you should get the latest version compatible with JIRA 4.4 first. I think this kind of problem has already been fixed in 1.1.3

I am using the JIRA Suite Utilities plugin. I have the latest verion 1.1.3.

Dieter Community Champion May 02, 2012

i just checked the source code of JSU 1.1.3 and that should work with both option values *and* IDs. Do you have more information in atlassian-jira.log ?

2012-05-02 05:56:45,674 http-8080-41 ERROR charu_yadav 356x173899x3 1hu5a2b 192.234.246.206 /secure/WorkflowUIDispatcher.jspa [jsu.workflow.function.UpdateIssueCustomFieldPostFunction] Unable to
update custom field 'customfield_10180 - Development Complete' in issue [DCTM-1784]
java.lang.IllegalArgumentException: No option found with value 'not done' for custom field Development Complete on issue DCTM-1784.
at com.googlecode.jsu.util.WorkflowUtils.convertStringToOption(WorkflowUtils.java:690)
at com.googlecode.jsu.util.WorkflowUtils.setFieldValue(WorkflowUtils.java:372)
at com.googlecode.jsu.util.WorkflowUtils.setFieldValue(WorkflowUtils.java:821)
at com.googlecode.jsu.workflow.function.UpdateIssueCustomFieldPostFunction.executeFunction(UpdateIssueCustomFieldPostFunction.java:76)
at com.googlecode.jsu.workflow.function.AbstractPreserveChangesPostFunction.execute(AbstractPreserveChangesPostFunction.java:59)
at com.opensymphony.workflow.AbstractWorkflow.executeFunction(AbstractWorkflow.java:869)
at com.opensymphony.workflow.AbstractWorkflow.transitionWorkflow(AbstractWorkflow.java:1265)
at com.opensymphony.workflow.AbstractWorkflow.doAction(AbstractWorkflow.java:567)
at com.atlassian.jira.workflow.OSWorkflowManager.doWorkflowActionInsideTxn(OSWorkflowManager.java:905)
at com.atlassian.jira.workflow.OSWorkflowManager.doWorkflowAction(OSWorkflowManager.java:865)
at com.atlassian.jira.bc.issue.DefaultIssueService.transition(DefaultIssueService.java:505)
at com.atlassian.jira.bc.issue.DefaultIssueService.transition(DefaultIssueService.java:513)

Dieter Community Champion May 02, 2012

ok, that makes things clearer:

It looks like 'not done' is not a valid option for custom field 'Development Complete'. You should check that in the the configuration of your custom field. I'm afraid the option is missing so you should either add it or not use the option anymore in your post function but maybe just clear the field.

If the option 'not done' does not exists anymore you will also notice that you don't have issues with that value. Custom field values which do not correspond to any configured option are deleted during upgrade to 4.4. Maybe you can still find some hints regarding this in your log file if the upgrade is not too long ago.

Thanks Dieter, I believe it is now working as expected.

I appreciate your patience and help.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

211 views 1 18
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