Screen data not saved during transition due to workflow properties in Jira DC
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
When configuring workflow properties to deny permissions such as "Logging work hours logged in the Closed status", you may notice transitions leading to the configured status "dropping" or "discarding" related changes submitted in the transition screen. Using the above example, you'd see that the issue was properly transitioned to the Closed status, but any work hours logged added to the form would not be added to the issue's logged hours.
Solution
This situation is caused by the ordering of the essential post functions in the default workflow settings.
The following will be processed after the transition occurs
Set issue status to the linked status of the destination workflow step.
Add a comment to an issue if one is entered during a transition.
Update change history for an issue and store the issue in the database.
Re-index an issue to keep indexes in sync with the database.
Fire a Generic Event event that can be processed by the listeners.
These essential post functions cannot be deleted from a transition or reordered.
As we can see above, the first step is to "set the new status", while saving the field values occurs only in the third step. Therefore, technically, the affected user is trying to apply their changes (such as logging their worked hours) when the issue is already at the "Closed" status (where said change is prohibited by the workflow property), which is why it fails.
Include an additional "Update change history" before the original first step
To workaround this, we can manually edit the workflow to include an additional "Update change history" before the original first step.
Detailed steps
Find the affected transition: Example:
<global-actions> <action id="151" name="Closed (2)" view="fieldscreen"> <meta name="jira.description"></meta> <meta name="jira.fieldscreen.id">1</meta> <results> <unconditional-result old-status="null" status="null" step="5"> <post-functions> <function type="class"> <arg name="class.name">com.atlassian.jira.workflow.function.issue.UpdateIssueStatusFunction</arg> </function> <function type="class"> <arg name="class.name">com.atlassian.jira.workflow.function.misc.CreateCommentFunction</arg> </function> <function type="class"> <arg name="class.name">com.atlassian.jira.workflow.function.issue.GenerateChangeHistoryFunction</arg> </function> <function type="class"> <arg name="class.name">com.atlassian.jira.workflow.function.issue.IssueReindexFunction</arg> </function> <function type="class"> <arg name="eventTypeId">13</arg> <arg name="class.name">com.atlassian.jira.workflow.function.event.FireIssueEventFunction</arg> </function> </post-functions> </unconditional-result> </results> </action>
Under post-functions, copy the existing "Update change history", and add it (without removing the original one) to the top of the list like so:
<global-actions> <action id="151" name="Closed (2)" view="fieldscreen"> <meta name="jira.description"></meta> <meta name="jira.fieldscreen.id">1</meta> <results> <unconditional-result old-status="null" status="null" step="5"> <post-functions> <function type="class"> <arg name="class.name">com.atlassian.jira.workflow.function.issue.GenerateChangeHistoryFunction</arg> </function> <function type="class"> <arg name="class.name">com.atlassian.jira.workflow.function.issue.UpdateIssueStatusFunction</arg> </function> <function type="class"> <arg name="class.name">com.atlassian.jira.workflow.function.misc.CreateCommentFunction</arg> </function> <function type="class"> <arg name="class.name">com.atlassian.jira.workflow.function.issue.GenerateChangeHistoryFunction</arg> </function> <function type="class"> <arg name="class.name">com.atlassian.jira.workflow.function.issue.IssueReindexFunction</arg> </function> <function type="class"> <arg name="eventTypeId">13</arg> <arg name="class.name">com.atlassian.jira.workflow.function.event.FireIssueEventFunction</arg> </function> </post-functions> </unconditional-result> </results> </action>
ℹ️ In the above, lines 8 - 10 have been inserted.
Save the changes and import the workflow back into Jira.
Now, change the Workflow Scheme to use the imported version.
Was this helpful?