Below js does not work for me in v5.1
Any help!!!!!
You can get the status of an issue through REST api
You will get a json output which contains the status value , u can process it to get the status .
EDIT : Try below javascript
<script type="text/javascript"> function getCurrentStatus() { var statusname; AJS.$.ajax({ url: "/rest/api/2/issue/XYZ-123", type: 'get', dataType: 'json', async: false, success: function(data) { statusname = data.fields.status.name; } }); return statusname; } alert("Status : " +getCurrentStatus()) </script>
What would I need to modify in above code to get it to work with JIRA 4.4.5?
Any help appreciated ;o)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For JIRA 4.4.5
function getCurrentStatus(){ var statusname; AJS.$.ajax({ url: "/rest/api/2.0.alpha1/issue/CAR-20", type: 'get', dataType: 'json', async: false, success: function(data) { statusname = data.fields.status.value.name; } }); return statusname; } alert("Status : " +getCurrentStatus())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For JIRA 4.4.5
function getCurrentStatus(){ var statusname; AJS.$.ajax({ url: "/rest/api/2.0.alpha1/issue/XVY-123", type: 'get', dataType: 'json', async: false, success: function(data) { statusname = data.fields.status.value.name; } }); return statusname; } alert("Status : " +getCurrentStatus())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In JIRA 7, you have the option to use this code to get the current IssueKey.
JIRA.Issue.getIssueKey();
So they can be combined to dynamically get the status of the issue you are viewing:
function getCurrentIssueStatus()
{
var statusname;
var issueKey = JIRA.Issue.getIssueKey();
AJS.$.ajax({
url: "/rest/api/2/issue/" + issueKey,
type: 'get',
dataType: 'json',
async: false,
success: function(data) {
statusname = data.fields.status.name;
}
});
return statusname;
}
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.