Forums

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

LATE state in the Task flow?

sabina volpicelli
May 9, 2023

Is it a good idea to have a LATE state in the Task workflow or are there better way to monitor late tasks?

1 answer

1 accepted

3 votes
Answer accepted
Mauricio Karas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 20, 2018

Hello, Christian. Thanks for reaching out to the Atlassian Community!

I've tried getting the issue key in the issue navigator with the AJS.$("#key-val").text() command but the same behavior happened, it returned null. After some search I was able to find out that it might be because the callback is pointing to the first HTML that rendered which doesn't have the class with the "key-val" id, the problem being the inline editing.

This other question from the Developer Community is describing something similar: Parts of javascript not working in issue navigator

One of the answers suggested is listening to a Jira JS event and then executing the code inside the listener function. I've created the following code and it seems to be working for the purpose of retrieving the issue key.

JIRA.bind(JIRA.Events.ISSUE_REFRESHED, function() {
var key = AJS.$("#key-val").text();
console.log("Issue Key: " + key);
});

There's further information on extending the inline editing in Jira is this page: Extending inline edit for JIRA plugins

Kind regards,
Maurício Karas

Christian_Schönert
Contributor
June 21, 2018

This is likely the most valuable answer I have ever received, thank you very much, also for the quick response. So now I'm calling my setup function from this event bind and pass the issue-key and it works smoothly.

I didn't know about all this inline stuff, this will help a lot in the future too.

So maybe you have time for a little more follow-up questions out of curiosity:

Why is it that always people recommend using the issue-key and never issue-id? I mean if they are both unique, why even bother to have two?

How would I get the ID then? AJS.$('#id-val")?

 

Best regards,

Chris

Mauricio Karas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 21, 2018

Glad to hear it worked on your end and that I was able to help.

I don't know exactly why is that the issue key is more used, you're right, they're both unique. I think it's because the issue key is more meaningful than the id, the issue key shows up in the Jira GUI so you can easily find what issue you are referring to.

Yeah, to get the id, the "id-val" doesn't seem to work. If you inspect the issue key next to the project's name you can see rel="<id>", which is the id you want. Another way that I've found, which I can see people using, is the following:

JIRA.Issue.getIssueId()
JIRA.Issue.getIssueKey()

This worked for me and I think is more readable than getting fields and HTML elements.

Kind regards,
Maurício Karas

Christian_Schönert
Contributor
June 26, 2018
JIRA.Issue.getIssueId()
JIRA.Issue.getIssueKey()

 This is of course the solution I tried at first (as stated), but this is exactly, where the inline doesn't work anymore. Imho it should still work then.

Nikita_Ishkov
August 28, 2019

It's broken for next-gen projects.

Shilpa Sanil
Contributor
August 3, 2021

Similar way is it possible to get the value for a customfield?

Christian L
November 7, 2023

It's broken for next-gen projects.

Is there a solution for next-gen projects in 2023?

Edit: at least the issue is closed, but not solved
https://jira.atlassian.com/browse/JRACLOUD-72940 

Suggest an answer

Log in or Sign up to answer