Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,465,889
Community Members
 
Community Events
176
Community Groups

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

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

2 votes
Answer accepted

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!

This is what we ended up doing.

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

Like Robin Flood likes this

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?

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

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

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

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

@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

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!)

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

@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

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.

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

@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 Oct 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!

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 Oct 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.

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 Oct 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.

Like Akshay Bhagwat likes this
Vinu Rising Star Oct 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

Thank you, that works! 

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 Jun 06, 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!!

@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

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

@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!!

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*

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. 

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 

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

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 

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
TAGS

Atlassian Community Events