Versions Compared

Key

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

The following solution was kindly provided by Stefano Gevinti

(thanks!)

.

Problem

At creation timeWhen creating an issue, you want to first assign the issue first it to the manager of the current user, to decide and categorize the issue. The problem is that enable prior decisions on category. However, the relationship between the current user and the manager is not declared in Jira (as a project admin, for instance), but in the LDAP.

Solution

create_postfunction.sil
Code Block
languagejava
string mgr = ldapUserRecord("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 = ldapUserRecord("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);
}
Info

This post function should be the last in the call chain

at create.

All you have to do now is to LDAP Configuration and there you go !

Note

The above assumes that the windows when creating an issue.

Now configure the LDAP.

Note

This solution assumes that the Windows account name is the same the user is using one used to access Jira. This is really dependent depends on the AD setup.

Table of Contents

Table of Contents