Upgrading Workflow Plugins for JIRA 3.2
If you have written a workflow plugin (Validator or Post Function) for JIRA 3.0 or 3.1 you might have to modify it to make it work for JIRA 3.2. If you are getting ClassCastExceptions while transitioning issues through workflow after upgrading to JIRA 3.2 there is a high chance that this document is what you are looking for.
Regular Workflow Transition
For a regular workflow transition in JIRA 3.1 the
transientVars map contained a GenericValue object that represented an issue. The
transientVars Map also contained the fields that were changed during the transition (if any), namely Fix Versions, Assignee and Resolution.
In JIRA 3.2 an Issue object has been created, and all the changes that have been made to the issue can be obtained from the Issue object:
Please note that in version of JIRA 3.1 and earlier the
transientVars map contained a
GenericValue object with the key "issue". If your code does something like:
This will cause a ClassCastException in JIRA 3.2. You need to cast the object to
Issue instead of
GenericValue. If you need to get the
GenericValue of the issue, you can do that by calling:
As mentioned earlier, the
modifiedFields map contains all the fields that have been updated during the workflow transition. The keys of the
modifiedFields map are ids of fields (please see
com.atlassian.jira.issue.IssueFieldConstants) that have been modified, and the values of the
modifiedFields map are
ModifiedValue objects. A ModifiedValue object represents an updated field. The object stores the old and the new value of the field for the issue. You can use this object like so
Please note, that the
commentLevel are still recorded in the
Initial Workflow Transition
An initial workflow transition is the transition that creates an issue.
In JIRA 3.1 and earlier the
transientVars map contained the field values that should be used to create an issue. In JIRA 3.2 the value of the fields are recorded in the Issue object rather than in the
transientVars map. You can use various getter methods to retrieve values of these fields. For example, if you need to get issue's description, instead of doing:
Was this helpful?
Thanks for your feedback!