How to write scriptrunner functions employee's manager or user's reporting manager name for jira Edited

create a script runner function that is manager of user  and reports directly to manager. 

1 answer

0 votes
Alexey Matveev Community Champion Jan 11, 2018


Where information about managers is stored?

@Alexey Matveev Its stored in Oracle database thats HR database fyi.

As a JIRA user I need ScriptRunner functions that will return direct reports and managers of a user based on information from our HR database so I can use them in scripts and JQL.

a function returning manager of an user exists and returns the same person as Oracle database.

a function returning direct reports of an user exists and returns the same list as Oracle Database.

Alexey Matveev Community Champion Jan 11, 2018

I would not do it as a JQL functin. The performance will be very low. You should do it as a scripted field. Then you can choose on the scripted field in JQL function. You can read more here about scripted field

You can query database like this

@Thanos Batagiannis [Adaptavist] could you please point me to a script that can help me with this issue? Please and thank you.

Hey @Vladimir Sid

@Alexey Matveev is absolutely right. The links to the documentation that he posted are a good start. 

Let me know if you get stuck.

@Thanos Batagiannis [Adaptavist] I would need your suggestion on how to write the script or a code snippet or template for user picker (for example user1) and return the result for user1's immediate manager (example: user2). As i started following the link I can find all other sorts of very useful info but not relevant to my query. Thank you.

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

321 views 0 12
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot