JJupin: How to work with Request participants field

Thomas_Pike March 15, 2017

All attempts to modify the Request participants Service Desk field with JJupin SIL scripting is failing with error "java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Collection".

Example code:

JUser[] participants;
participants = addElement(participants, getUser("admin"));
#{Request participants} = participants;

Another attempt:

#{Request participants} = addElement(#{Request participants}, getUser("admin"));

And another:

#{Request participants} = addElement(#{Request participants}, "admin");

Am I doing something wrong, or is JJupin not capable of handling the Request participants field?

3 answers

1 accepted

5 votes
Answer accepted
Alexandru Geageac
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.
March 15, 2017

Hi Thomas,

 

Could you please go to Custom Field Mappings and chage the Value factory to  User[] -> string[]? 

This should do the trick.

 

HTH,

Alex

Thomas_Pike March 15, 2017

Hi

Setting it to "User[] -> string[]" worked perfectly, thank you!

Radu Dumitriu
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.
March 15, 2017

Anyway, how do you like version 4.0.0 so far? We are pretty proud of it smile ...

Thomas_Pike March 15, 2017

I haven't had a chance to use any of the new features yet, but it looks very good. I expect we'll be making use of the JQL support as well as the JIRA Agile and JIRA Service Desk integrations. Possibly the mail handlers too. I can say though that the UI improvements are nice smile

0 votes
Thomas_Pike March 15, 2017

For reference this is with JIRA Software 7.2.7, Service Desk 3.2.7 and JJupin 4.0.0

Application_Group September 13, 2017

Hi Thomas,

I can't get this working when using JUser[] but using string[] instead works. Also, this may or may not be relevant to you but I noticed that if I am trying to request participants on any other transition than the create transition, then it works if I refer to the custom field directly rather than as #{..}.

In my case, I am requesting participants on a later transition and the string[] worked as soon as I reverted to using customfield_10408 = <value>

 

If you could share some thoughts on what could be stopping the JUSer[] from working, that'll be really great.

 

Thanks

Anupam

Thomas_Pike September 14, 2017

Hi Anupam

The accepted solution worked for me ("go to Custom Field Mappings and change the Value factory to  User[] -> string[]")

0 votes
Michael Partyka
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.
March 15, 2017

Hi,

give a try with string array participants:

string[] participants={};

participants = addElement(participants, getUser("admin"));
#{Request participants} = participants;
Thomas_Pike March 15, 2017

Hi

Thanks for the reply, but I get the exact same results with a string array (in fact that was what I tried in one of my first attempts).

Like Michael Partyka likes this

Suggest an answer

Log in or Sign up to answer