The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to perform an 'issue action' using AJAX?

Deleted user
August 11, 2017

Hi,

I am writing a JIRA add-on that adds a button to the workflow buttons area. When the button is clicked I send a request to a REST API using JS.

I want that the issue gets 'greyed out' if I click the button so that the user is not able to take any actions anymore. If you go offline and click for example 'Assign' inside an issue, you will see what behaviour I mean. After the action has finished I want that the issue gets reloaded.

My question is now if there is an API which I can use in order to do this or if I have to implement my own logic.

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Deleted user
August 24, 2017

I found out how to dim the screen and show the loading spinner:

AJS.dim();
JIRA.Loading.showLoadingIndicator();

To undim use the following:

AJS.undim();
JIRA.Loading.hideLoadingIndicator(); 

The issue can be updated with the following call:

JIRA.trigger(JIRA.Events.REFRESH_ISSUE_PAGE, [JIRA.Issue.getIssueId()]);
Thor
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 24, 2017

Glad you found the solution :-) Thank you for sharing this.

0 votes
Thor
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 12, 2017

What do you exactly mean by "gets greyed out"? You could transform the issue to another status for example. That status could prohibit users to take more actions on an issue (e.g. status -> "Done" / "Closed" and remove "re-open" action / hide it from certain users).

Deleted user
August 15, 2017

I attach a recording of what I mean with "greying out". I don't want to introduce any status transitions.

disabled-issue.gif

TAGS
AUG Leaders

Atlassian Community Events