Hello,
I'm trying to implement the following use case in a project workflow.
As a controler I've to approve or reject a ticket in my workflow step. When approved I have to assign it to the next controler in process. the project has various project roles to distinguish approval responsibility in the whole process.
Therefore I searched for a way to dynamically pre populate the assignee user picker field on the approval transition screen. It should be limited to users that are only members of the next accountable project role. So the intential goal was to limit user selection in the assignee field.
After some investigation it appears there is no way to accomplish that. So I followed another idea. I've created a helper/transient custom field (single select) put it on the transistion screen and pre populate it with all members of the desired project role in its options. In conjuction with a scriptrunner behaviour initalizer and change script I'm able to set the now hidden assignee field on that transition screen.
So far so good, now I'm faced with the server side validation that prevent the transition due to the fact that the dynamically created options in the helper select field are unknown and invalid.
I'm slightly frustrated. :-)
I can't maintain all Users as pre defined options in the custom field configuration to filter them later as seen in many script examples. Is there a way to disable the form field validation of the custom field? Or any other ideas to implement the described use case?
Best greetings,
René
Hi @Lucas Z so you are validating your helper field? And for dynamic field, do you use this functionality?
https://scriptrunner.adaptavist.com/latest/jira/behaviours-conversions.html
Hi Martin,
thank you for your advice. that looks promising. i'll try the text field conversion method in the next few days and give you feedback!
Regards,
René
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok @Lucas Z , good luck :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Martin Bayer _MoroSystems_ s_r_o__ ,
the text field conversion method using FormField.convertToSingleSelect() worked. However, I did not find a way to pre-select one from the selection options supplied by the REST endpoint!
FormField.setFormValue() does not work now and I have not found any other way.
As a workaround I now use a hint in the field description. Feels incomplete but works for the user! :-)
Thanks again for your hint!
Best regards,
René
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok @Lucas Z happy to help. It is not easy to put default value to dynamic list because options are loaded after user starts writing...
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.