JIRA 4.3 : Using a Workflow to control edit of an issue by changing Workflow XML
This page last changed on Jan 04, 2010 by alui.
You can use a workflow "transition" to allow certain users to only edit certain fields of an issue without transitioning to another step of the workflow. This page outlines how to achieve this using direct Workflow XML manipulation. If you are not comfortable with directly editing Workflow XML please see How can I control the editing of issue fields via workflow?. First note that JIRA's workflow editor (as of Jira 3.4.2) uses the term "transition" where as the OSWorkflow documentation refers to the same element as an "action". As mentioned above, this article assumes knowledge of how to write an OSWorfkow in XML. There are two items that allow us to use the workflow in this way:
First, you will need to create a screen containing all the fields you want (and only those fields) the user to be able to edit. Next you need to create the XML document for the workflow. An easy way to get started is to export a workflow from JIRA as XML In each step that you want a specific user group to be able to edit the issue, create an action with the following
(if you don't know the ID of the screen you want to use, just reassign the screen, after importing the XML, using JIRA's workflow editor).
The following is an example: <action id="2003" name="Edit Issue" view="fieldscreen"> <meta name="jira.fieldscreen.id">10010</meta> <meta name="jira.description">Edit Issue (for Client)</meta> <restrict-to> <conditions> <condition type="class"> <arg name="group">ourclients</arg> <arg name="class.name"> com.opensymphony.workflow.util.OSUserGroupCondition </arg> </condition> </conditions> </restrict-to> <results> <unconditional-result old-status="Not Done" status="Done" step="2"> <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="class.name">com.atlassian.jira.workflow.function.event.FireIssueEventFunction</arg> <arg name="eventType">updated</arg> </function> </post-functions> </unconditional-result> </results> </action> Note that version 2.8 of OSWorkflow allows common actions with a step value of "0" which should result in no change of the step value after executing the action. |
![]() |
Document generated by Confluence on Mar 27, 2011 18:51 |