How to restrict Log Work on a specific status

Still need help?

The Atlassian Community is here for you.

Ask the community

Purpose

Sometimes it'd make sense to prevent users from logging work time while it is in a specific status.  In order to achieve this, we can make use of a workflow property called jira.permission.work.denied.
This option will disable the logging of work on specific status, as well as disallow users from editing or deleting work log in the activity tab.

(warning) Important notes:

  • This option is only applicable for JIRA version 8.0 and above.
  • Due to  JRASERVER-70504 - Getting issue details... STATUS , log work during an incoming transition will silently fail (ie. The hours logged when transitioning to the modified status will not be registered to the issue, and no error message will be displayed, however, the transition will complete successfully).

Solution

  1. In Jira, go to Jira administration (gear icon) > Issues > Workflows.
  2. Click on the Edit link for the Workflow you want to adjust.
  3. Select the Status where you need to restrict the logging of hours, and then click on Properties.
    Example:
  4. Add 'jira.permission.work.denied ' to the Property Key in the Add New Property form.
  5. Add a Property Value as True
    Example:
  6. Go back to the Workflow Step page and Publish the changes.
    (plus) The alterations to the workflow will only be valid after publishing the changes.
  7. Note: If you observe the property is being ignored by the workflow, request you to follow the steps mentioned below:
    1. Export the workflow as XML
    2. Make sure the below snippet exists in the workflow. If it does not exists, request you to add it on the top of the workflow: 

      <validator name="" type="class">
      <arg name="class.name">com.atlassian.jira.workflow.validator.PermissionValidator</arg>
      <arg name="permissionKey">MANAGE_SPRINTS_PERMISSION</arg>
      </validator>
      </validators> 

      c. Save the xml and import it as workflow. 


Last modified on Mar 21, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.