Hi all,
I realized some problem and wanted to confirm if you can see this as well.
I have setup a Service Desk test page, where I have added the following fields:
- Priority
- a select field
- an Asset custom field for selecting objects
The same custom script code is applied to all 3 fields for validation. For Priority and the select field, it is working fine.
The plan is to use the Asset object for manipulating the UI and for example providing a template text in the description. However, it appears the behaviour is not even triggered for Asset custom fields when the value changes. It is only triggered once the page is reloaded (and yes, this is not added in the initialiser section ;) )
Is there some kind of limitation, that the behaviours are only triggered on page reload for Asset custom fields on Jira Service Desk request type pages?
I am already using this within plain Jira and there it is working without any issues.
Do you have any idea, if there is something missing in the SD Portal pages for behaviours to be working with Asset fields?
Thanks for your help!
Stefan
Could you please share the Behaviour code you are using for the Asset field so I can review it and provide some feedback?
Also, please clarify: How are you invoking the value of the Asset field? Are you using ScriptRunner's HAPI feature?
When using the Asset field, if you are directly trying to passe the value of the Asset field, it will not work as the Asset field will pass the Asset's key. Certain filtration needs to be done for it to work as expected.
I am looking forward to your feedback and clarification.
Thank you and Kind regards,
Ram
Hi @Ram Kumar Aravindakshan _Adaptavist_
thanks for your reply.
I do already know, how to work with the Asset custom fields in behaviours outside of the JSM portal. We already use it a lot within Jira Software.
The script code is very simple for testing purposes and does not have anything to do with value handling of Asset fields.
getFieldByName('Description').setRequired(getFieldById(getFieldChanged()).value?true:false)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In your last comment, you mentioned:-
So the idea is to set the description field to required if there is a value set, otherwise set it to optional.
Please clarify: When you say "there is a value set", are you referring to when there is a value set in the Asset field?
I am looking forward to your feedback and clarification.
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ram Kumar Aravindakshan _Adaptavist_
"there is a value set" simply means, that the user selects one object in the Assets field.
I do not fetch any attribute on the object, it is really mean like "does this custom field has a value set or is it empty".
As I said, this is only for demonstration, but it already shows that the behaviour is not executed for Asset custom fields in the portal.
Regards,
Stefan
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.