Uncorrect issue creation status data

Hello,

I’m receiving the event of Jira issue creation after setting up a webhook for that.

The problem I’m having right now is when creating a new issue on a column different from the TO-DO(it has the TO DO status) column, the event comes saying that the issue has been created on the TO-DO column.
Here is an example of an issue that was created in the In Progress column(it has the IN PROGRESS status)

"status": {
                    "self": "https://hexacker-dev.atlassian.net/rest/api/2/status/10000",
                    "description": ",
                    "iconUrl": "https://hexacker.atlassian.net/",
                    "name": "To Do",
                    "id": "10000",
                    "statusCategory": {
                        "self": "https://hexacker.atlassian.net/rest/api/2/statuscategory/2",
                        "id": 2,
                        "key": "new",
                        "colorName": "blue-gray",
                        "name": "To Do"
                    }
                }

The expected statusCategory here is:
key: indeterminate
colorName: yellow
name: In Progress

Has anyone already faced this issue before?

Best.

Hello @Hexacker

Are you saying:

  1. The issue was created with the correct status of In Progress, but the response from the REST API is wrong and telling you it has the status of To Do (IE, the response is incorrect), or
  2. The issue was created with the status of To Do but that’s not what you expected to happen.

To me, it sounds like the issue was created, but with the default status of To Do because the transition to the In Progress status didn’t happen for one reason or another and the REST API response is just telling you that.

First, have you tested the same request outside of Forge with a test tool like Postman or a raw cURL request etc?

Next, does the issue get the correct status if you transition it to the In Progress status after you create it (separate API call)?

Lastly, you mention ‘columns’. Are you talking about the columns of a Board? If so, an issue won’t appear those columns unless it’s part of an active sprint. By default, newly created issues are always in the backlog and therefore not visible in any ‘column’ of a Board. Can you clarify what you meant by the word ‘column’ in your question and if you put the issue in a sprint during its creation using the Create Issue endpoint.

Can you also please provide the complete code for the API call you made to the Create Issue endpoint to create that issue, including the transition parameter elements. Also include the exact response from the endpoint when creating the issue

1 Like

Thank you for your detailed reply. Let me explain my question in detail:

Yes, the columns I meant in my original post are the board columns.
The issues are created directly on the board, I’m trying to recreate a real-world scenario as I used to see, team members create live issues directly on the boards for emergency tasks.

For your question:
1- Yes, the issue is created with the correct status of In Progress, but the response from the REST API is saying that it was created in the TO-DO.

This is what’s happening right now step by step:
1- I create a new issue in the In Progress column(this column has the status of In Progress)

2- The REST API sends the event to my endpoint saying that the issue was created on the TO-DO column(which has the To-Do status)

3- When moving the issue from In Progress to Under Review for example, the REST API, there is a key in the request body named “changelog” is the only who has the correct information saying that the issue has been moved from In Progress to Under Review.

I just discovered that “assiociatedStatues” has the correct changes too.

Hello @Hexacker

Sorry, but I really don’t understand much of what you are saying, as you only are ‘half’ explaining everything. Also, you’re using lots of Jira terms, all jumbled together, so it’s really hard to know what, exactly, you are doing via the GUI, your API requests in Forge are doing, your webhook is doing or some workflow is doing (you have all four of these tags in your question) and when.

1- Yes, the issue is created with the correct status of In Progress, but the response from the REST API is saying that it was created in the TO-DO.

Here you say an issue is created ‘WITH’ a status of In Progress, then you sort of change subject about the REST API response telling you it was created ‘IN’ TO-DO. Since you use the word ‘IN’ I assume you mean “In a Column called TO-DO” and I don’t simply understand that, as the response from the Create Issue endpoint does not, under any circumstance, contain anything about any columns; it only ever contains information about statuses.

1- I create a new issue in the In Progress column(this column has the status of In Progress)

What do you mean by ‘I create a new issue’? You, personally create it using the GUI? A request from Forge to the Create Issue API endpoint creates it?
Issues cannot be created ‘in a column’ as you express it. The issue must be created, given a particular status, then put in a sprint. If that sprint is active, then that will cause the issue to appear in a column. You seem to using the words and concepts of ‘column’ and ‘status’ interchangeably.

2- The REST API sends the event to my endpoint saying that the issue was created on the TO-DO column(which has the To-Do status)

Why does this REST API send an event to an ‘endpoint’? What causes it do that… something in Forge or something in the workflow? Which ‘endpoint’ is sending this event? Do you actually mean a webhook since webhooks deal with ‘events’, not REST APIs?
Again, you can’t create an issue ‘ON’ or ‘IN’ a column directly, you’re using mixed metaphors.

3- When moving the issue from In Progress to Under Review for example

How is it moving? By you, personally moving it via the GUI? By you or Forge making a REST API request to move it? Is the workflow moving it? Are the things called ‘In Progress’ and ‘Under Review’ statuses or names of columns?

, the REST API, there is a key in the request body named “changelog” is the only who has the correct information saying that the issue has been moved from In Progress to Under Review

What ‘key’? What ‘request body’? What is making this ‘request’.
You seem to also say that when you use the REST API to get the changelog of the issue, that the changelog contains a record that the issue ‘moved from’ A to B, but it’s unclear if that means “shifted location from column A to column B” or means “changed from status A to status B”. Since the changelog does not record anything about columns, I know it’s not possible to know about an issue’s movement between columns on a Board by looking at the changelog.

You use the verb ‘move’ to mean both “shift location” (for columns) and “change” (for statuses) interchangeably, so it’s really hard to know the context you are inferring.

I asked you to provide code examples for a really good reason, but you didn’t. I also asked you to provide the actual responses from your requests for a really good reason, but you didn’t. I also asked you if you had done testing outside Forge to validate your API requests, but you didn’t answer that question.

Perhaps it might be better if you opened a support request with Atlassian and filled out a comprehensive request form. They can then spend the time working with you to determine what you’re doing and how.

Other than that, I don’t think I can be of further assistance to you.

Best of luck.

Thank you @sunnyape for your willingness to help me. I just found a workaround for this issue.

Sorry for not providing all of the information you asked for, I was in a rush to find a solution.

To just clarify the case, I used the GUI to create, update, and move issues between the Jira board’s columns, and yes, I was receiving the events from a webhook I set up previously.

The keys I mentioned in my reply are in the webhook request received each time a tracked event happened.

Thank you again for your help and your time.

Best.

No problems :slight_smile:

If I had to guess by what you’ve said so far, it seems that you are under the impression that Issues have some ‘knowledge’ of what Board column they are in at any particular point in time, or that they contain a record of those Board columns or their movement between them somewhere in their changelogs. Based on this, you are expecting a response from one of Jira’s REST API endpoints to provide information about an issue’s current or past Board columns.

This is not possible because Issues are essentially ‘blind’ to any Board columns they are displayed in, because Boards are fundamentally just viewports for collections of Issues based on filters. Board columns and their names are further abstract groupings of those Issues based on their status. As a result, any one Issue with a particular status could appear on hundreds of Boards in multiple Projects simultaneously, all with different columns with different names that present the issues in different ways.

You can also refer to this ‘Is there a secret way to find out what board an issue belongs to?’ thread that discusses how to determine what sprints an issue is in, which will then tell you what boards it is being viewed in.

Anyhow, glad you worked out a solution.

Exactly, that’s exactly what I was expecting, I thought that when a user creates a new issue, it’ll automatically discover which column it was created in.

Thank you for the explanation and thank you again for your time and help.

Best.

1 Like