Update board when script field value changes

Пономарёв Михаил January 29, 2019

Is it possible to automatically update kanban board, that has a filter ordered by script field, when the script field value changes?

When the scripted field value changes, issues on the board do not reorder as expected, the user has to refresh browser page.

1 answer

1 accepted

0 votes
Answer accepted
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 30, 2019

Hi Mikhail,

There is a bit of a browser side blocker for this one, as once the javascript is loaded in the users browser the content becomes static, and a query from the client side needs to send a query to the server to request an update for changed content via a refresh, which is a major blocker to implementing a feature for this in the application that does not disrupt content for other users.  One thing to keep in mind is that a page refresh will cause a user to loose any field data they are in the middle of typing, so the refresh event would need to be localized to a non disruptive client call rather than periodic update server side.

There was a partial implementation in place back in jira 6.0.4 for this but it is only triggered when the local user is able to initiate certain localized event to trigger a query to the server and an update in the data is detected but that section of the UI no longer exists in the current version of jira so the functionality was lost, But please check out the details on the existing feature requests for this at the links below with further discussions on this, noting these are very long running requests due to the complexity of implementation:

This next link is a previous post that goes into detail on a method to force a refresh after a user triggers an update via an inline edit event in the details view of a board using a java hack, again though this requires client side initiation of an action and after that action is complete client side the follow script triggers the page refresh for the board:

But just siting idle on a page you would need to have a periodic refresh event triggered to initiate the reload and you could do an additional Javascript hack in the announcement banner to trigger a page refresh on an interval of inactivity with something similar to this, but this can get pretty disruptive as a periodic refresh as noted above could cause a user to loose data they are trying to input in a field. 

Overall I would highly recommend against using a periodic update but if this is a critical implementation for your use case, you could try to combine the focus saved event noted in the previous post, with the example given in the link above for a periodic refresh trigger a refresh every 60 seconds of inactivity when all the desired criteria is met.  Also note that the query in the example is triggered globally so you would also want to fine tune the refresh event as much as possible to localize the script to only launch on a desired board.

Regards,
Earl

Пономарёв Михаил January 31, 2019

Thank you for the answer!

When I look at the board and someone else is changing rank of an issue using drag&drop, it updates automatically, so I thought it is possible to fire the same event which triggers upate on all clients.

Suggest an answer

Log in or Sign up to answer