How to remove optional post functions from the initial transition in a workflow
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
Symptoms
It is not possible to remove or re-order 'essential' post functions when added to the initial transition. The post functions affecting this behavior are:
Re-index an issue to keep indexes in sync with the database.
Stores updates to an issue (no change history is created).
Add a comment to an issue if one is entered during a transition.
Set issue status to the linked status of the destination workflow step.
Cause
When you add a transition to any workflow in JIRA, JIRA automatically adds 5 'essential post functions' to that transition, which cannot be deleted.
On the other hand, a workflow's 'initial transition' only has 2 'essential post functions':
One of which is 1 of the 5 'essential post functions' (required for other transitions)
The other of which is unique to any workflow's 'initial transition'.
However, you can add the remaining 4 'essential post functions' (required for other transitions) to the 'initial transition', as 'optional post functions'.
This is a bug tracked here JRASERVER-25070 - You cannot delete / remove optional post functions which have been added to the 'initial transition' (i.e. 'Create' transition) of a JIRA workflow.
Workaround
Download the workflow as XML
Locate the initial 'Create Issue' transition, which would look similar to this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
<initial-actions> <action id="1" name="Create Issue"> <meta name="opsbar-sequence">0</meta> <meta name="jira.i18n.title">common.forms.create</meta> <validators> <validator name="" type="class"> <arg name="class.name">com.atlassian.jira.workflow.validator.PermissionValidator</arg> <arg name="permission">Create Issue</arg> </validator> </validators> <results> <unconditional-result old-status="Finished" status="Open" step="1"> <post-functions> <function type="class"> <arg name="class.name">com.atlassian.jira.workflow.function.issue.IssueCreateFunction</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.IssueStoreFunction</arg> </function> <function type="class"> <arg name="class.name">com.atlassian.jira.workflow.function.issue.IssueReindexFunction</arg> </function> <function type="class"> <arg name="class.name">com.atlassian.jira.workflow.function.event.FireIssueEventFunction</arg> <arg name="eventTypeId">1</arg> </function> </post-functions> </unconditional-result> </results> </action> </initial-actions>
Remove the unwanted post functions. In this case we are removing the 4 post functions which can't be removed from the UI, so the XML ends up looking like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
<initial-actions> <action id="1" name="Create Issue"> <meta name="opsbar-sequence">0</meta> <meta name="jira.i18n.title">common.forms.create</meta> <validators> <validator name="" type="class"> <arg name="class.name">com.atlassian.jira.workflow.validator.PermissionValidator</arg> <arg name="permission">Create Issue</arg> </validator> </validators> <results> <unconditional-result old-status="Finished" status="Open" step="1"> <post-functions> <function type="class"> <arg name="class.name">com.atlassian.jira.workflow.function.issue.IssueCreateFunction</arg> </function> <function type="class"> <arg name="class.name">com.atlassian.jira.workflow.function.event.FireIssueEventFunction</arg> <arg name="eventTypeId">1</arg> </function> </post-functions> </unconditional-result> </results> </action> </initial-actions>
Import the workflow XML
Was this helpful?