Custom field value getting repeated

Neha Sharma July 24, 2018

Hi all,

I have a custom field called "Groups(s)" of type PCF - Multiple Autocomplete. The values for the custom field are populated (auto-complete) using a sil script which extracts the values from an LDAP. Below is the sil code for extracting the values. 

struct Group {

string displayName;
//string mail;
}

Group[] Xgroups = ldapUserList({"displayName"}, "(&(groupType:1.2.840.113556.1.4.803:=8)(mail=*)(displayName=*companyX*))", "groups");

return arrayStructSort(Xgroups , "displayName");

Now we have another sil script configured for sending mails when we change the workflow of an issue. We populate the value of the custom field in the mail. I extract the value of the custom field (which is multi-valued) as below - 

if (isCustomFieldInContext("Group(s)",projectKey,"Incident")) {
xGroups= #{Group(s)};
} else {
xGroups= "";
}

But the values that are populated in the mail looks like - 

Group A|Group A

The same value is repeated twice. maybe, its because the ldap search returns results based on the attributes I give. I tried making a few changes to the script, like using a string array instead of the struct array (not sure how to manipulate the query) but nothing seems to work. 

 

Can anyone suggest how can I get rid of the repeated values ?

 

Thanks,

Neha

 

1 answer

0 votes
Wouter Bruinings
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 3, 2018

Hi Neha,

I am not very familiar with the structs returned by your ldap, but in case your customfield consistently returns an array with two of the same values, you can consider to simply take the first index of the array returned?

 

xGroups= #{Group(s)}[0];

Kind regards, 

Wouter

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events