Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Button handy | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
The following solution was kindly provided by Stefano Gevinti.
Problem
When creating an issue, you want to first initially assign it to the manager of the current user, to enable prior decisions on category's manager for review. However, the Jira lacks a predefined manager role is not defined in Jira (for example, as a project admin), but in . To address this, you need to access the Lightweight Directory Access Protocol (LDAP).
Solution
Enter the
script provided below:
create_postfunction.sil
Code Block | ||
---|---|---|
| ||
string mgr = ldapUserRecordldapUserAttr("manager", "(sAMAccountName=" + currentUser() + ")"); //get the current user's manager DN string cnUser = substring(mgr, 0, indexOf(mgr,",")); //establish the cn, this is the manager user (that may depend on your setup) string mgrUserName = ldapUserRecordldapUserAttr("sAMAccountName", cnUser); //again, a lookup in the Active Directory to get the manager //Note: these LDAP calls are automatically cached, so performance gets better if it is found in cache if(userExists(mgrUserName)) { //make sure this is defined in JIRA assignee = mgrUserName; } else { //fallback to project admin assignee = projectPM(project); } |
In this script, we used the preferred ldapUserAttr function but you can also use the deprecated ldapUserRecord function.
Info |
---|
When creating an issue, make sure that this post function is the final step in the call chain. |
Next, configure the LDAP.
Note |
---|
This solution assumes that the Windows account name is matches the same one used to access for accessing Jira. This depends on the Active Directory (AD) setup. |
Table of Contents
Table of Contents |
---|