Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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?

4 answers

1 accepted

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

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?

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. 

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

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!

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

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 

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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Why everyone using Jira must be GDPR-compliant

Did you know that penalties up to 4 % of the yearly company turnover are possible in case of GDPR violations? GDPR regulations are currently mainly relevant for companies in the EU, but countries lik...

79 views 1 2
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you