Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Button handy
blanktrue
color#0052CC
nameSend Feedback
linkhttps://docs.google.com/forms/d/e/1FAIpQLScmToBe3vynAlb5fdKwCGxYqnTbDc66sIBgeecG2BuFDuHc7g/viewform?entry.2002826954=Perform+searches+with+LDAP+-+15481607
widthauto

The following solution was kindly provided by Stefano Gevinti

(thanks!)

.

Problem

At creation timeWhen creating an issue, you want to initially assign the issue first to the manager of it to the current user, to decide and categorize the issue. The problem is that the relationship between the current user and the manager is not declared in Jira ('s manager for review. However, Jira lacks a predefined manager role (for example, as a project admin, for instance), but in the LDAP). To address this, you need to access the Lightweight Directory Access Protocol (LDAP).

Solution

  1. Enter the script provided below:

create_postfunction.sil
Code Block
languagejava
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);
}
This post function should be the last

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

at create

.

All you have to do now is to LDAP Configuration and there you go !
  1. Next, configure the LDAP.

Note

The above This solution assumes that the windows Windows account name is the same the user is using to access matches the one used for accessing Jira. This is really dependent depends on the Active Directory (AD) setup.

Table of Contents

Table of Contents