How do I add an approval to a Jira software project workflow?

Kumar Aniket October 17, 2018

I have created a workflow for a software project on Jira software. Can i create an approval process without using the service desk?

5 answers

1 accepted

3 votes
Answer accepted
Robin Flood October 17, 2018

Hi Fumida!

At our organisation we've implemented this for our copy team, you do need the JSU plugin for this, I highly recommend this plugin, very useful.

1. Create a custom user picker field called 'Approver'

2. Create a transition called 'Approve' that leads to the desired status.

3. Add the condition 'User Is In Custom Field' and choose the 'Approver' field you created in step 1.

Might be other ways to achieve this, even without the add-on as well, but this is how we did it at least :)

Hope it helps!

Kumar Aniket August 13, 2019

This is what we ended up doing.

Like Анатолий likes this
Irina Sytkovetska
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!
August 14, 2019

Fantastic! This is very helpful! I will try to do it as well

Like Robin Flood likes this
Alexey Byzov October 20, 2020

Dear All,

Sorry, could you please clarify, how to make it work? What is condition and where and how to add it? What is user picker?

felix.weber March 10, 2021

Hey @Alexey Byzov  at best you make yourself familiar with the advanced issue workflows 

User picker is a field where you can select other users in your environment - as the name implicit a "user picker" field ;) 

I hope this answers your question ;) 

 

If only 1 Approver is required the easy setup from above does the trick

Everett Cavazos April 20, 2021

You can also create automation that notifies the approvers that they have a pending approval. I set that up for my company, and also included Slack notifications. I also have automation to notify the assignee whenever it's approved.

Like # people like this
Sina Abdi July 14, 2021

How exactly did you do this? I’m trying to do the same

Krzysztof Bogdan November 5, 2021

I would recommend you to try Approval Path for Jira: https://marketplace.atlassian.com/apps/1220490/approval-path-for-jira

Simon Archambault March 21, 2023

If multiple user approval is required, you can create several user-picker fields, each having it's associated approval custom checkbox fields (or whatever). Make those approval checkbox fields visible only from their respective transition screen (transitioning to same status, e.g. Pending Approval -> Pending Approval) for editing +  standard View Screen for visualization.

Once all users have approved (async), you can add a final transition (which you maybe able to automate?) that has Value Field condition checks on the approval checkbox fields.

Multi-User Approval.png

 

Like Atlassian Sales likes this
Todd Johnson April 20, 2023

@Simon Archambault that screen looks really interesting, what do you have on the General, Analysis and Release screens and what they used for?

On the approval side of things, does the actions then fire off a notification to the Project Lead or Requester which then updates the fields on the screen?

Simon Archambault April 21, 2023

We are using a JIRA project to track Engineering Change Requests, the other tabs provide information related to that ECR.

Our approval chain does not currently automatically send a notification, but that is likely possible to automate:

Automation.png

Like Mauro Radaelli likes this
Tupling June 13, 2023

@Simon Archambault - What plugin are you using to accomplish this? 

Simon Archambault June 13, 2023

No plugin required! Just custom fields / screens / etc.

Like Mauro Radaelli likes this
Tupling June 13, 2023

Interesting, I am curious about the Actions menu you have... I assume you are in a Cloud environment?

Simon Archambault June 13, 2023

Correct, cloud.

Actions button is always there.

temp.png

5 votes
Krzysztof Bogdan November 5, 2021

I am a developer of Approval Path for Jira. It is a go-to solution for setting up the approval process. Is it available on marketplace: https://marketplace.atlassian.com/apps/1220490/approval-path-for-jira.

I think this is the most versatile and flexible solution for approval in Jira.

You can easily manage approvals,
the approval process is presented very intuitively:

https://api.media.atlassian.com/file/8aed4a46-ee80-4acc-ab47-b3652ab5effe/binary?token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJkNmM4NDFkZi0xNmI2LTRhMDAtYTc1NS1kODU1Y2MwMDk5YmEiLCJhY2Nlc3MiOnsidXJuOmZpbGVzdG9yZTpmaWxlOjhhZWQ0YTQ2LWVlODAtNGFjYy1hYjQ3LWIzNjUyYWI1ZWZmZSI6WyJyZWFkIl19LCJleHAiOjE2MzYxOTg5MjEsIm5iZiI6MTYzNjExNTk0MX0.ZYTHgIGm59UHehMgB2yt3cTIFfcs_GmuLnzpdzRLgR4&client=d6c841df-16b6-4a00-a755-d855cc0099ba&name=ss_IssueVIewStarted.png

Also, there many more features like:

  • API access
  • Automation steps
  • Notifications
  • External users
  • and more...

We provide a similar solution for Confluence:
Approval Path for Confluence

Cloud Account
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!
January 5, 2022

@Krzysztof Bogdan Good day!

Can you please tell me if notifications in the cloud work? I am testing this step, but notifications are not received in the mail. What am I doing wrong?

Thanks a lot!

Like Krzysztof Bogdan likes this
Krzysztof Bogdan January 6, 2022

Hello @CloudA@Cloud Accountplease reach us via or support portal here: https://warsaw-dynamics.atlassian.net/servicedesk/customer/portal/1

We will investigate this.

(Happy New Year!)

Chris Anders March 10, 2022

Hi @Krzysztof Bogdan

I am implementing the Approval Path for Jira. It works ok for User and Issue Field - User but for Issue field Group it doesn't not seem to acknowledge the approvals when Approve button is used. Reject works fine. Any known issues or is this a config problem? 

Thanks

Krzysztof Bogdan March 10, 2022

@Chris Anders 
Hello!
I can see you already summited question about this problem via our support portal.
Right now we are trying to replicate this problem. I will let you know about progress.

 

Best,

Krzysztof Bogdan

Chris Anders March 10, 2022

Thanks @Krzysztof Bogdan

You guys are very responsive - much appreciated.

FYI - it seemed to start working after I moved this into the parallel group. I will take it back out and see if it stops working and let you know.

Chris Anders March 10, 2022

I have implemented the Approval Path app from market place suggested above which solves everything (for me).

Worth noting that:

  • This allows parallel approvals requests so you do not have to wait on step by step. (drag the single steps into the "parallel group". Not super obvious. 
  • You can have step by step though so person B can't approve until person A has done so
  • You can you use a pre-determined set of approvers by using Jira Groups
  • You can use a dynamic set of approvers by using the "approvers" field from the issue

Perfect solution for me. Only concern is number of emails it generates. But I hit the daily limit on my sandbox instance if Jira so haven't worked out a solution to that yet - nor had a chance to see what gets generated to who. Doesn't help that i'm the requester, approver, implementer, and owner of the change! :)

One other thing -The small glitch in the groups process i mentioned above. I raised a support ticket and it was fixed within 2 hours! - Nice one @Krzysztof Bogdan & team. 

Like # people like this
Krzysztof Bogdan March 11, 2022

@Chris Anders 

Amazing! Thank you for your feedback!

We plan to improve visual guidance for parallel-group and add examples in the documentation.

On the other hand - our app does create comments for every 'major' event in the approval path like start, accept, reject, reset with a summary.

In that case, you might try to tweak the notification scheme in Jira so it will match your preference.

5 votes
Vinu
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.
October 18, 2018

Hi @Fumida Ashraf

Robin Flood's suggestion is one way to go about it, and as he mentioned you can also make use of the default conditions on your workflow to get this function.

1. Create a project role called approver and set the role to those who will approve the requests.

2. Put in a status called approval in your WF.

3. Put a condition on the outgoing transition from approval status called "User is in project Role" that restricts the transition to those in the role "Approver". This is a built-in condition, so no need of plug-ins.

That way only the approvers will be able to transition the issue.

Hope this helps!

Kumar Aniket October 30, 2018

Thank you for the suggestion. I tried this out but I am not able to see the button for transitions with the project role condition associated with them. Do you know what might be the issue here?

Vinu
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.
October 30, 2018

Hi @Fumida Ashraf

If you are unable to see the transition to where you have put in a condition, it means you are not allowed to perform the transition and the condition has turned out to be false.

Recheck if you are in the project role to which you restricted the condition to.

Kumar Aniket October 30, 2018

Hi,

As I'm currently in the testing phase, I am the only one in the project role to which the condition is restricted. 

Vinu
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.
October 30, 2018

Can you paste a screenshot showing how the condition is put in? From what you say, I do not see any reason on why the transition should be hidden for you.

Kumar Aniket October 30, 2018

Screen without transition.PNGCondition.PNGProject Role.PNG

Like Akshay Bhagwat likes this
Vinu
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.
October 30, 2018

Hello

So you have set yourself as a default member of the role. This will take effect only for projects that are created from now and not to ones that are already present.

Go to your project, project settings -> Users are roles. Click Add user to role and add yourself to this role there. That should do.

Like Sai Kishore likes this
Kumar Aniket October 30, 2018

Thank you, that works! 

SenecaGlobal June 5, 2019

Hi @Vinu 

I have a question extending to this topic, hence posting it here. 

Is it possible for me to give a set list of Approvers among which the User can choose one or more Approvers for their issue?

I am using OnDemand Jira and want to implement this in a Software Project. 

 

Thank you!

Vinu
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.
June 6, 2019

Hi @SenecaGlobal 

You can definitely do this. But I cant get me brain to think of any options straight out of the box. you need to install some thirdparty plugin to get you this.

I would suggest to go for Adaptavist Scriptrunner. you can put a user picker and then let the users select the aprover and get the condition in through a groovy script.

You can get the scripted condition from this link.

Hope this helps!

Cheers!!

Marc Colangelo June 13, 2019

@SenecaGlobal  I was recently asking this same question...well at least how can I get approval process into jira software.  I really like the way they do it in service desk, but not something you can just move into jira software workflows...

Rachel in my thread provided some good insight.

https://community.atlassian.com/t5/Jira-Software-questions/How-do-I-create-an-Approval-process-similar-to-Service-Desk-in/qaq-p/1097405#M48379

Like Marini Marini likes this
1 vote
Kántor Tibor March 31, 2021

After extensive googling and using the massive knowledge in this community, I put together a solution using SriptRunner which works much like the one in Service desk:

  1. Create custom field “Approvers” (if not present already)
    1. Add to necessary screens
  2. Create technical custom field “Approvals pending”
    1. Do not add to any screen
  3. Set up workflow
    1. Add Post function on create transition to fill technical custom field
      1. import com.atlassian.jira.component.ComponentAccessor
        import com.atlassian.jira.issue.MutableIssue
        import com.atlassian.jira.issue.fields.CustomField
        import com.atlassian.jira.user.ApplicationUser

        CustomField approvers = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Approvers")
        CustomField approvals_pending = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Approvals pending")

        List users = issue.getCustomFieldValue(approvers) as List
        if(users == null)
        return;

        issue.setCustomFieldValue(approvals_pending, users);

         

    2. Add “Waiting for approval” status
      1.      Add simple scripted condition to all outgoing transitions
        1. !cfValues[‘Approvals pending’]
    3. Add “Approve” transition to self on "Waiting for approval"
      1.      Add simple scripted condition to “Approve” transition
        1. cfValues[‘Approvals pending’]
      2.      Add simple scripted condition to “Approve” transition
        1. currentUser in cfValues['Approvers']
    4. Add custom scripted post function to “Approve” transition to remove users currently approving
      1. import com.atlassian.jira.component.ComponentAccessor
        import com.atlassian.jira.issue.MutableIssue
        import com.atlassian.jira.issue.fields.CustomField
        import com.atlassian.jira.user.ApplicationUser

        ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getUser()

        CustomField approvers = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Approvals pending")

        //Delete user
        List users = new ArrayList <> ();

        for(ApplicationUser multiUseruser: (List) issue.getCustomFieldValue(approvers)){
        if(!multiUseruser.getKey().equals(user.getKey())){users.add(multiUseruser)
        }
        }
        issue.setCustomFieldValue(approvers, users);

         

    5. Create “Reject” transition from “Waiting for approvals” to any previous status
      1.      Add custom scripted post function in 3.1.1. to transition to refill approvers
        1. If there is a reopen transition, add the script there too(generally to every transition which goes before the approval)
  4. If “Approvers” field is editable during workflow, you should add a custom listener to keep “Approvals pending” field up-to-date
    1.      Trigger: issue update event
    2. import com.atlassian.jira.component.ComponentAccessor
      import com.atlassian.jira.issue.MutableIssue
      import com.atlassian.jira.issue.fields.CustomField
      import com.atlassian.jira.user.ApplicationUser
      import com.atlassian.jira.issue.ModifiedValue
      import com.atlassian.jira.issue.util.DefaultIssueChangeHolder

      def issue = event.issue
      CustomField approvers = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Approvers")
      CustomField approvals_pending = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Approvals pending")

      List users = issue.getCustomFieldValue(approvers) as List
      if(users == null)
      return;

      approvals_pending.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(approvals_pending), users), new DefaultIssueChangeHolder())
  5. Enjoy
Sina Abdi July 14, 2021

@Kántor Tibor @Thank you for your time and effort for compiling all this data. However, is it possible you can make a video of this for those who can’t follow along textually. It really would be appreciated, help, and go a long way..

either way, thanks!!

Rajeev Joshi July 6, 2022

Kantor Tibor,  Thank you for the detailed steps.  I am trying to implement the same in Jira Cloud version using ScriptRunner for Jira Cloud.  ScriptRunner for cloud using REST API, so the implementation is quite different that what you have and it seems the features are limited.  Can you suggest ideas and answer to the question I had described here?

https://community.atlassian.com/t5/Jira-Software-questions/How-to-get-the-current-user-using-ScriptRunner-Jira-cloud-and/qaq-p/2064899?utm_source=dm&utm_medium=unpaid-social&utm_campaign=P:online*O:community*I:social_share*

Rajeev Joshi July 6, 2022
1 vote
Elizabeth Huber
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!
July 16, 2020

I don't believe I have any special plug-ins for this, but I had downloaded a few ready-made workflows over time and I usually use them to copy statuses, transitions, and properties that I like into my own workflows. 

There's an approval button that I like very much. When you create a new status called Approval or Waiting for Approval, open Properties and add the following:

Property Key: approval.transition.approved

Property Value: 901

 

Property Key: approval.transition.rejected

Property Value: 911

 

Property Key: approval.condition.type

Property Value: number

 

Property Key: approval.condition.value

Property Value: 1

 

Property Key: approval.active

Property Value: true

 

Property Key: approval.field.id

Property Value: customfield_XXXXX

*Where the X's represent the custom field number of your custom Approver field. You can find the field number of your custom field in the URL of the edit or the configuration screen. Example: ...?customFieldId=XXXXX

Once you have set your properties accordingly, refresh your workflow draft page and click on the status. You will see a new checkbox called Add Approval with a link to configure next to it. Configure the the following:

Get approves from: Your customer field for Approvers

Consider approved after: All approvals or n number of approvals.

Where to transition if approved or denied. 

JIRA Study July 28, 2020

Hi @Elizabeth Huber, I'm new to Jira Software. I have no idea about properties other than these https://confluence.atlassian.com/adminjiraserver/workflow-properties-938847526.html properties.

I tried to follow the steps as you said but I don't see the Add Approval Checkbox. Could you please help to get this get this done.

 

Clarification_JIRA.jpg

I was under the impression following these steps will be the workaround for the issue  https://jira.atlassian.com/browse/JRACLOUD-62053 

Atticus Bikos January 22, 2021

Does this apply to the customer portal side of approvals for Jira Service Desk? 

felix.weber March 10, 2021

I also guess the suggestion from @Elizabeth Huber relates to the Jira ServiceDesk Management (ServiceDesk) 

In the JSM project you will find those properties when you setup the approval process - however I am afraid you can´t use it in the same way in Jira Software projects

But I find time will test this 

David Willson October 20, 2021

When you have Service Desk installed (a paid license required) you get an extra option when you click on any status called 'Add approval' - So you need Servicedesk to see that configuration option. There are then extra parameters on that status that can be set. That will determine what field to get the approvers from what to transistion to use when it is approved.

Here is some info on that - https://confluence.atlassian.com/adminjiraserver/configuring-jira-service-management-approvals-938847527.html

Suggest an answer

Log in or Sign up to answer