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

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


1 badge earned


Participate in fun challenges

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


Gift kudos to your peers

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


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!


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
Community Members
Community Events
Community Groups

Scriptrunner - differentiate Edit vs Field Edit from View

My issue type has many fields on few tabs, including a custom field date type on tab 2.

When the user edits the date we need a behavior to check and set another custom field. This works fine.

From the View screen if they try to directly edit the date, the Edit screen pops since that is how behaviors work. Executing `switchTab(2)`takes them to the correct tab and the field has focus. Beautiful.

What I need is a way to differentiate when they do this, versus simply clicking the Edit button to open the edit screen to change another field. When that happens right now the behavior fires and tab 2 is displayed.

How can we test the special case where the user want to edit a field from a behavior versus simply edit the issue?

I hope this is clear, thanks!


1 answer

1 accepted

0 votes
Answer accepted
Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 03, 2023

I do not believe that it is possible from a behaviour initialiser script to detect if the screen was opened by clicking the edit button or attempting to open an in-line edit.

I would view this as a feature request (or bug) for Adaptavist to have whatever logic automatically puts the focus on the field that the user clicked on to trigger the dialog (something in the javascript layer) to identify and automatically switch to the correct tab so that the auto-focus works in all cases (right now it only works when the field is on the first tab).

IMO, this should be built-in and you should not have to code the tab change.

Suggest an answer

Log in or Sign up to answer