Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I prevent the reporter from triggering a workflow transition?

Sverre Morka
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 7, 2019

In our company we have created a workflow, which has an approvement step after the initial creation of the Issue. 

An Issue can be approved by anyone, except the reporter. Or at least, that is the Idea. 

After creation the Issues get the state Awaiting Approval, and then if approved they get the state Backlog. 

We've tried using the Separation of Duties Constraint to get this to work. 

Approve Issue Transition -> Constraint : Users that have performed the following transition may  not do this transition: Any State -> Awaiting Approval 

However, that does not seem to work, because Any State does not trigger on created state, I.E. No state. 

There is a constraint Reporter Only, However, there is no negation on it as in Everyone but the reporter

Does anyone have an Idea on how we can acheive this? 

4 answers

1 accepted

2 votes
Answer accepted
Sal
Contributor
March 24, 2023

I came across this issue and able to do it on Jira Sofware cloud using the below steps.

  1. Create new custom field something like "Reporter 2User Picker (single user).
  2. Add post function on ticket creation - Copy Value From Other Field.
  3. In Post function select 'Source field: Reporter' and 'Destination field: Reporter 2' (created in step 1.)
    Screenshot 2023-03-24 130856.png
  4. On the approval transition, add a condition - User Is In Custom field.
  5. In the above condition, select 'user must be: not in field' and 'Field: Reporter 2' (created in step 1)
    Screenshot 2023-03-24 131203.png
  6. Publish and test.
2 votes
Angélica Luz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 7, 2019

Hi Sverre,

Welcome to Atlassian Community!
Currently, it's not possible to prevent the reporter to approve their own issues. If they have permission, they will be able to do this. We have a feature request suggesting the implementation of this ability:
- https://jira.atlassian.com/browse/JSDCLOUD-6678
Please, click on vote and watch to receive updates.

The best option, in this case, would be adding a Condition in the workflow, but there is nothing specific for reporter, so all users that usually are only approvers of tickets, you could add them to a group or role for example, and then add the condition to only allow them to execute the transition.

Regards,
Angélica

0 votes
Maciej Dudziak _Forgappify_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 8, 2024

If you're open to using apps or already have one providing Jira expression-based validators/conditions, then I think a simple expression would suffice:

user.accountId != issue.reporter.accountId

which would prevent the transition if the current user is the reporter

There are several options available on the Atlassian marketplace

I am from Forgappify, and we developed Jira Expression Validator, which is part of the Workflow Building Blocks for Jira free app. 

I would appreciate it if you could give it a try.

Cheers

Glenn Castillo May 8, 2024

Nice one! Thank you for this tip. It looks like this could also be an alternative. I like how it looks and love that it's free - nice work!  I'll let you know if I try this out.

0 votes
Glenn Castillo May 8, 2024

@Sal that looked promising at first but I couldn't get it to work when I tried it.

I found something that works for us! It's called "Include an approval step" in the Workflow!

⚠️CAUTION! Editing and publishing a Workflow that is active, will affect and change the workflow for ALL projects that share this workflow!

  1. From the service project, select Project Settings> Workflows.
  2. Select Edit next to the workflow you want to add an approval to.
  3. Select Diagram if you’re not already in the diagram view.
  4. Select the status you want to add an approval step to.
  5. Check the box next to Include approval step.
  6. Next to Include approval step, select Edit.
  7. Next to Number of approvers, select how many people you want to approve the issue.
  8. Next to Approver source, select Jira Field > Approvers.
  9. Select Next.
  10. Select the statuses to transition to if the issue is approved or declined.
  11. Under Exclude approvers from, select the Reporter field (or any field you want to exclude approvers from).
    • Any users that appear in the fields you select here will not be able to approve issues that use this workflow.
  12. Select Add.

Then we use Automation to do other things to those issues where the Approver = Reporter.

Using only the above steps, the reporter can still add themself as an approver, but they can't actually approve it. So the issue will be in "limbo" and still have the status: "WAITING FOR MANAGER APPROVAL".

Source documentation: Add an approval step to a workflow | Jira Service Management Cloud | Atlassian Support

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events