Use ScriptRunner to set focus on a given field when using a behaviour

Kenneth D _Kent_ Mahan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 6, 2023

When creating issues/tickets in Jira, we are currently using ScriptRunner Behaviours to show/hide fields based on a dropdown field, as well as setting components based on that same dropdown field.  The show/hide & components part is working exactly as we want it to.  However, Jira leaves the component field as the focus on the screen, & leaves the cursor in the component field ready to enter additional components.  If the fields to be displayed are more than can be displayed on the screen, it focuses the screen on the components field and the user has to scroll back to the top to complete the form.  How do I set the focus back to another field, & make the cursor active in that field?  Ideally, I would want the screen to re-focus on the summary field, & make the cursor active back in that field.

1 answer

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 7, 2023

Hi @Kenneth D _Kent_ Mahan

Could you please share the code you currently use so I can review it and try to reproduce the problem in my environment?

Also, please share the current version of Jira and ScriptRunner you are using. I am asking for this to configure my environment to match yours and try to replicate this.

Thank you and Kind regards,

Ram

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events