Forums

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

User Management hierarchal relation

Arthur S
Contributor
April 14, 2022

Hi,

 

We have a dedicated project where the users are creating tickets which needs to be validated by their manager before to be send in an approved status. Currently, we ask the users to assign their manager to do it.

I am trying to find a way to automate that. Is there a way to have a hierarchy of the users in Jira to define users N+1 which I can user after in the workflow to automatically assign the issue to those N+1 for validation ?

 

Thanks in advance

4 answers

1 accepted

0 votes
Answer accepted
Arthur S
Contributor
April 15, 2022

Hi,

 

I found a way to do it. I will have to create a property manager with the value Username of the user's manager and then, create a custom script post function in my workflow with the following script 

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.UserPropertyManager
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.issue.ModifiedValue

//Gets the user property value based on the key.
def propertyKey = 'manager'; //Property name
UserPropertyManager userPropertyManager = ComponentAccessor.getUserPropertyManager();
def propertyValue = userPropertyManager.getPropertySet(issue.getReporter())?.getString('jira.meta.'+propertyKey);

//Gets the approver based on the property.
ApplicationUser approver = ComponentAccessor.getUserManager().getUserByKey(propertyValue);
issue.setAssignee(approver);

 

In my case, it works, hope it can help.

 

Arthur

1 vote
Eduardo Oliveira - Mindpro Apps
Atlassian Partner
April 27, 2022

Hi @Arthur S  - Not sure if you already solved this issue, but if you're open to using an app, I would like to share a potential solution that may help in this scenario: MindPro Sync.

 

Basically, this app allows you to:

  • Integrate OKTA, Azure AD, or OneLogin with Jira and JSM and retrieve user attributes (phone, location, department, etc..)
  • Map them in Jira custom fields and display this data directly to Jira issues or JSM requests (and portal)
  • Show user hierarchy, and reporting lines in issues and JSM requests to facilitate escalation and approvals
  • And automatically assign approvers based on user hierarchy or via workflow post function.

 

If this solution fits your use case, give it a try.

 

All the best,
Eduardo from MindPro (Marketplace Partner)

Arthur S
Contributor
April 28, 2022

Hi,

 

Thanks but I found my solution as described in the accepted solution. Also I am not on Jira cloud.

 

Best regards,

Arthur

1 vote
Fabio Racobaldo _Herzum_
Community Champion
April 14, 2022

Hi @Arthur S ,

multiple approvals is not a builtin feature within JIRA. My suggestion is to try Herzum Approval Plugin https://marketplace.atlassian.com/apps/1211763/herzum-approval?tab=overview&hosting=server that allows to manage multiple approval and move ticket automatically to a new status when approval validation has been validated.

Hope this helps,

Fabio

Arthur S
Contributor
April 14, 2022

Hi,

 

Thank you but it's not what I am looking for. My current issue is to be able to know people's manager into Jira. I have an external source which can provide me this information and I am looking how to include it into Jira in order to use it for that kind of project.

 

Best,

Arthur

Fabio Racobaldo _Herzum_
Community Champion
April 14, 2022

Sorry for the misunderstanding.

The only way to do that is to develop your own post function on creation that automatically assign issue to reporter manager retrieving user manager from the external source.

I saw that plugin https://marketplace.atlassian.com/apps/42075/metadata-for-jira?tab=overview&hosting=server that allows you to add metadata to users. Btw, I don't know if that information can be automatically imported forom the external source and if that information can be used by an automation.

Like Arthur S likes this
Arthur S
Contributor
April 14, 2022

Hi @Fabio Racobaldo _Herzum_

 

Thank you, it looks like it would do the trick. I was looking to do it without a plugin but if I have no choice, I will test it.

 

I saw we can add property on user, I was also thinking it could do the trick, no ? 

user_properties.PNG

 

Thanks,

Arthur

Fabio Racobaldo _Herzum_
Community Champion
April 15, 2022

Hi @Arthur S ,

if that property can be accessed through the API/Automation, yes

Like Arthur S likes this
0 votes
Karyna Tyrnavska _SaaSJet
Atlassian Partner
April 15, 2022

Hi, @Arthur S 

You can try Business Process Manager for solving this issue. We have a special Approver step that allows streamlining any processes that have been accepted by another person.  

This add-on is developed by my SaaSJet team, so If you have any additional questions, I'm here to help you

Arthur S
Contributor
April 15, 2022

Hi,

 

Thanks but it's not what I am looking for. My question is how to get people's manager to auto assign them for approval.

 

Best,

Arthur

Karyna Tyrnavska _SaaSJet
Atlassian Partner
April 17, 2022

Sorry, I misunderstand you. I guess that optimization can help to solve your issue

Suggest an answer

Log in or Sign up to answer