I've been using behaviours on cloud, and I'd like to display a message on a particular issue, when it reaches a particular status.
But.... I'm struggling with the issue status. I've got it via trial and error on the API (see below)... but surely I can get it off context? But I'm just not sure of the syntax?
-----------------
I tried this:
//This didn't work returned argument of type "status" not assignable
const issueStatusFieldVal = getFieldById("status");
-----------------
I got this working - but surely there must be a better way? Can someone help me to get the status straight from context.extension..... (I tried a few ways but didn't work)
//Get this issue key
const context = await getContext();
const thisIssueKey = context.extension.issue.key;
//From the issue key get the status of the issue
const requestTextString = "/rest/api/3/issue/" + thisIssueKey.toString() + "?fields=status"
const res = await makeRequest(requestTextString);
const thisIssueStatus = res.body.fields.status.name