Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,557,435
Community Members
 
Community Events
184
Community Groups

convertToMultiSelect only saves the last selected value

We have a simple Behaviour to convert a single select field to a multi-select: 

getFieldByName("Craft").convertToMultiSelect()

When I edit an issue using this Behaviour, I can select multiple values but only the one I choose last is actually saved, and no more than one value is ever saved.

I tried it this way too, but no change:

getFieldByName("Craft").convertToMultiSelect([ 
ajaxOptions: [
query: true, // keep going back to the sever for each keystroke
minQueryLength: 0,
keyInputPeriod: 500,
formatResponse: "general",
]
])

We're running Scriptrunner 6.0.0-p5 on Jira Service Desk 4.6.1.

3 answers

1 accepted

0 votes
Answer accepted
Alejandro Suárez
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.
May 28, 2020

You cant convert single select to multi select. It may have the same appearance but you cant store multiple values in a single select select list field.

You must have a text field to do that.

The ScriptRunner documentation for this is pretty bad - they never mention it must be a text field. Hell, in their "Walkthroughs", they never even attach it to a field. But, they do show a screenshot of it working and the field name they use throughout is called "TextFieldB" (or similar). So, you can figure it out, if you try. Still, pretty bad on their part.

How about any documentation for the `convertToMultiSelect` method at all? All we get are examples that happen to use options. Where is the list of all the options?

Why does this use the keys when displaying?

Are both text and html required for "general" responses?

Pretty terrible solution, imo.

0 votes
Muhammad Ramzan_Atlassian Certified Master_
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.
May 14, 2020

What is the current field type which you are converting ?

Like I said, it's a single select.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events