Hello,
I'm trying to add a post function that creates multiple issues using a seed JQL, and from that seed JQL I'm copying some fields to the resulting issues.
I'm facing two errors at this point:
1) Updating a field of type User Picker (single user), I'm not able to use a parser expression to get the first user from a list, but it works if I just copy a field from the current issue, like reporter. My parser expression is:
first([%{Parent's multi-user-picker-field (Seed)}, %{Parent's different-multi-user-picker-field (Seed)}])
The parser expression validates and returns a result correctly if I'm testing within the post function itself, but on ticket creation I get the following error:
We can't create this issue for you right now, it could be due to unsupported content you've entered into one or more of the issue fields. If this situation persists, contact your administrator as they'll be able to access more specific information in the log file.
2) Updating a field of type Single Issue Picker, I can copy the same field from the current issue to the same field in the created issue, however, I'm trying to copy the issuekey of the seed issue. I should note that the single issue picker field uses a JQL for a valid list, and the seed is part of that JQL and I can select it manually.
For the second issue, the initial ticket gets created, but not the ticket from the post function.
Any guidance on what I may be doing incorrectly here would be greatly appreciated!
Your configuration is correct, however you have encountered two different problems which I will proceed to explain one by one:
^%{parent.aaaaa}
Where aaaaa would be your User picker (multi) field code.
Besides, I would recommend you using the following expression instead, which is less error-prone because it uses some of our parser functions.
first(union(toStringList(^%{parent.aaaaa}), toStringList(^%{parent.bbbbb})))
However, I can confirm that both this bug and this new feature are already being work on and their fixes will be released as soon as possible.
In the screenshot below you can see an example on how the post-function could look like.
I hope this helps.
Cheers,
Sergio.
Thank you so much @Sergio del Pino _Decadis AG_ ! I appreciate the detailed response. Is there a ticket I can follow for the fixes being released please?
Thank you,
Pierre
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We do not have an external ticket for the fixes, however, if you want I can let you know when they are being released right in this ticket.
Although I would recommend you to create a ticket in our customer portal letting us know about both of this errors, where it will be easier for us to let you know about the releases.
Cheers,
Sergio.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Sergio del Pino _Decadis AG_ ,
I'll go ahead and create a ticket.
Would you mind letting me know what the release date will be as well please?
Thank you
Pierre
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Sergio del Pino _Decadis AG_
Wondering if I can pick your brain again on this same issue. I'm trying to set the Assignee of the created ticket using the same function that you explained:
first(union(toStringList(^%{parent.aaaaa}), toStringList(^%{parent.bbbbb})))
But adding to that a third field that's a single issue picker, not a multi issue picker like the original fields. The expression I'm trying to use is:
first(union(union(toStringList(^%{parent.aaaaa}), toStringList(^%{parent.bbbbb})), toStringList(^%{parent.ccccc})))
since a union only does two lists so I'm unioning a union.
Now the other thing I tried is not do the toStringList since my understanding is that this function takes a list and converts it to a string list, however the single issue picker is not a list.
Now my expression returns the correct results when I test it, but I can't save the expression because JWT doesn't think it's a valid expression. The error I get if I click the red exclamation mark next to the expression is:
PARSE ERROR: "^%{ccccc}" is not a valid Multi-Valued field identifier, i.e., Multi-Select, Checkboxes, Multi-User, Multi-Group, Versions, Labels, Components, Issues or Attachments.
Any guidance to what I'm doing incorrectly would be greatly appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Pierre Ibrahim,
If you need to create a text list composed by two multi-valued fields and a single value field, follow these instructions:
This expression would be written as follows:
toString(distinct(toStringList(toString([^%{parent.cfaaaa}, ^%{parent.cfbbbb}, ^%{parent.cfcccc}]))))
We hope that this response was helpful.
Regards,
Vicente
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Vicente Domínguez _Decadis AG_ ,
A variation of your solution worked for me, thank you!
For anyone else that may need this in the future with a use case like mine, Vicente's expression gets a list of all the values from the array. However since I'm putting this in the Assignee field I only want one result to return, the first result.
first(distinct(toStringList(toString([^%{parent.cfaaaa}, ^%{parent.cfbbbb}, ^%{parent.cfcccc}]))))
Vicente's response explains the different operators used perfectly, the only variation I did is instead of enclosing everything in a "toString()" I enclosed in a "first()" instead. That returns the first result of the resulting array and does not cause a parse error.
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.