Hi all,
Hoping someone can help me with my problem. I searched around about removing square brackets in this community website and also google. But I can't seem to find the answer that could help me.
My problem is, I'm using lookupIssues to get all approvers of all request tickets. The Approvers field is a custom field, and it has one or many picklist value. I tried this piece of code in the automation log just to see the list of approvers that I need to send the email to:
Approver list: {{#lookupIssues.customfield_10003.displayName.distinct}}{{.}};{{/}}
However, the list I got has square brackets in each name; e.g. [John Smith]; [Jane Doe]; [Steve McQueen]
The JQL for my lookupIssues is like this:
project = SIT AND status = "Waiting for approval" AND "Approvers[User Picker (multiple users)]" is not EMPTY
Ultimately, my goal is to get the list of approvers and put them in the To: field of an email to remind the approvers of the pending requests.
Can someone please help guide me how I could remove the square brackets from the resulting list of approvers? Or is there a better to get to my goal?
Cheers.
These are not really Brackets in the text, and they're telling you that each name is a value in an array or list. The brackets are acting as item delineators, not text.
This is because a multi-picker is a list of options.
You do not need to "remove brackets", you should iterate over the returned list.
Hi Nic,
As always, I appreciate your quick responses to my queries.
Apologies if I'm a bit lost here. By "you should iterate over the returned list.", what/how exactly would I do this? Would be able to give me some example?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried havig this in the log:
Approver list: {{#list}}{{customfield_10003.displayName.distinct}}{{.}};{{/}}
But I got a blank result.
Perhaps my syntax is wrong?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.