Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single Digit IssueTypeID in JIRA causes an ERROR - Not a valid Jira Issue Type ID - JIRA Cloud #8560

Closed
mathiasdaniel opened this issue Feb 6, 2024 · 15 comments
Labels

Comments

@mathiasdaniel
Copy link

Describe the bug
This Bug causes when you try to create a JIRA Ticket with the JIRA Node.

In our case we are using JIRA Cloud, before switching to JIRA Cloud we used JIRA on premise and there was no problem at all.
With JIRA on premise the IssueTypeID was five digits long, example 10003. This works, with JIRA Cloud a IssueTypeID with only one digit, example 3 fails.

If you put a single digit IssueTypeID, Example 3, into the IssueTypeID Form Field, there will be an Error when an JIRA Ticket should be created by the JIRA NODE.

In Detail:
a single digit IssueTypeID as fixed Value is not allowed, Error via regex check:
IssueType_forbidden_by_Regex

if you ship the IssueTypeID as JS Element as expression, it generates an error after the execution:
IssueType_Error_with_Expression

if you ship the IssueTypeID as number as expression, it generates an error after the execution, also invalid URL:
IssueType_Number_as_Expression_URL_Error

To Reproduce
Bild an Workflow with one Start and one JIRA nodes direkt in Line.
After the execusion of the JIRA node with the Create Operation and Issue Ressource you will recieve this error(s).

Environment:

OS: Docker

n8n Version 1.26.0

Operation mode : own

Has anyone a suggestion how we could fix this thing?
THX
.

@Joffcom
Copy link
Member

Joffcom commented Feb 6, 2024

Hey @mathiasdaniel,

What happens if you select the issue type from the dropdown box does that work?

@mathiasdaniel
Copy link
Author

Hey @mathiasdaniel,

What happens if you select the issue type from the dropdown box does that work?

Hey @Joffcom,

good advice, but there is also a Problem:

IssueType_from_list_doesnt_work
BTW the JIRA User has admin privilegs (for fixing this bug), so there should be no problems with JIRA Cloud right policy.

@Joffcom
Copy link
Member

Joffcom commented Feb 6, 2024

Hey @mathiasdaniel,

Can you configure an HTP Request node to use the same credential and set the URL to https://your-instance.atlassian.net/rest/api/2/project/10980 and see if that works?

It can also fail to load if the project id isn't correct as an example for my test project which is the first project in my jira instance the id is 10000 and for my issues I have...

Task - 10001
Epic - 10002
SubTask - 10003

Don't forget that these are IDs internal to Jira, I would be very surprised if you had single digit IDs on Jira Cloud.

@mathiasdaniel
Copy link
Author

@Joffcom we are also surprised of one digit IssueTypeIDs - after the migration from jira server to jira Cloud.

The Test via HTTP Post Request works:
Call_web_Request_works

@Joffcom
Copy link
Member

Joffcom commented Feb 7, 2024

Hey @mathiasdaniel,

Can you try the request option I provided so we can see what Jira is replying with?

@mathiasdaniel
Copy link
Author

Hey @Joffcom

I changed the Method to GET and the URL to https://our_instance.atlassian.net/rest/api/2/project/10980

Here is the Output:

[
  {
    "expand": "description,lead,issueTypes,url,projectKeys,permissions,insight",
    "self": "https://our_instance.atlassian.net/rest/api/2/project/10980",
    "id": "10980",
    "key": "SYS",
    "description": "",
    "lead": {
      "self": "https://our_instance.atlassian.net/rest/api/2/user?accountId=712020:9b30ad14-d3cd-4ed3-a41c-b4c440712355",
      "accountId": "712020:9b30ad14-d3cd-4ed3-a41c-b4c440712355",
      "avatarUrls": {
        "48x48": "https://secure.gravatar.com/avatar/877d5474e20eee516937ba75a901555a?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHM-5.png",
        "24x24": "https://secure.gravatar.com/avatar/877d5474e20eee516937ba75a901555a?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHM-5.png",
        "16x16": "https://secure.gravatar.com/avatar/877d5474e20eee516937ba75a901555a?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHM-5.png",
        "32x32": "https://secure.gravatar.com/avatar/877d5474e20eee516937ba75a901555a?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FHM-5.png"
      },
      "displayName": "Dale and Evil",
      "active": true
    },
    "components": [
      {
        "self": "https://our_instance.atlassian.net/rest/api/2/component/13760",
        "id": "13760",
        "name": "Mando",
        "description": "Mando",
        "isAssigneeTypeValid": false
      },
      {
        "self": "https://our_instance.atlassian.net/rest/api/2/component/13660",
        "id": "13660",
        "name": "Boba",
        "isAssigneeTypeValid": false
      },
      {
        "self": "https://our_instance.atlassian.net/rest/api/2/component/13661",
        "id": "13661",
        "name": "Opal",
        "isAssigneeTypeValid": false
      }
    ],
    "issueTypes": [
      {
        "self": "https://our_instance.atlassian.net/rest/api/2/issuetype/3",
        "id": "3",
        "description": "Eine Aufgabe, die ausgeführt werden soll.",
        "iconUrl": "https://our_instance.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/11418?size=medium",
        "name": "Aufgabe",
        "subtask": false,
        "avatarId": 11418,
        "hierarchyLevel": 0
      },
      {
        "self": "https://our_instance.atlassian.net/rest/api/2/issuetype/10001",
        "id": "10001",
        "description": "User Story",
        "iconUrl": "https://our_instance.atlassian.net/images/icons/issuetypes/story.svg",
        "name": "Story",
        "subtask": false,
        "hierarchyLevel": 0
      },
      {
        "self": "https://our_instance.atlassian.net/rest/api/2/issuetype/1",
        "id": "1",
        "description": "Ein Problem, welches die Funktion von OPAL beeinträchtigt oder gar verhindert.",
        "iconUrl": "https://our_instance.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/11403?size=medium",
        "name": "Fehler",
        "subtask": false,
        "avatarId": 11403,
        "hierarchyLevel": 0
      },
      {
        "self": "https://our_instance.atlassian.net/rest/api/2/issuetype/10000",
        "id": "10000",
        "description": "Eine thematische Klammer für andere Vorgänge",
        "iconUrl": "https://our_instance.atlassian.net/images/icons/issuetypes/epic.svg",
        "name": "Epic",
        "subtask": false,
        "hierarchyLevel": 1
      },
      {
        "self": "https://our_instance.atlassian.net/rest/api/2/issuetype/10302",
        "id": "10302",
        "description": "Ein Problem mit einem System oder einer Software",
        "iconUrl": "https://our_instance.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/11403?size=medium",
        "name": "Problem",
        "subtask": false,
        "avatarId": 11403,
        "hierarchyLevel": 0
      }
    ],
    "email": "jira_mail@our_instance.de",
    "assigneeType": "UNASSIGNED",
    "versions": [
      {
        "self": "https://our_instance.atlassian.net/rest/api/2/version/29849",
        "id": "29849",
        "name": "1",
        "archived": false,
        "released": false,
        "projectId": 10980
      }
    ],
    "name": "System",
    "roles": {
      "atlassian-addons-project-access": "https://our_instance.atlassian.net/rest/api/2/project/10980/role/10102",
      "Service Desk Team": "https://our_instance.atlassian.net/rest/api/2/project/10980/role/10101",
      "Service Desk Customers": "https://our_instance.atlassian.net/rest/api/2/project/10980/role/10100",
      "Technical User": "https://our_instance.atlassian.net/rest/api/2/project/10980/role/10103",
      "Administrators": "https://our_instance.atlassian.net/rest/api/2/project/10980/role/10002",
      "Users": "https://our_instance.atlassian.net/rest/api/2/project/10980/role/10000"
    },
    "avatarUrls": {
      "48x48": "https://our_instance.atlassian.net/rest/api/2/universal_avatar/view/type/project/avatar/10201",
      "24x24": "https://our_instance.atlassian.net/rest/api/2/universal_avatar/view/type/project/avatar/10201?size=small",
      "16x16": "https://our_instance.atlassian.net/rest/api/2/universal_avatar/view/type/project/avatar/10201?size=xsmall",
      "32x32": "https://our_instance.atlassian.net/rest/api/2/universal_avatar/view/type/project/avatar/10201?size=medium"
    },
    "projectTypeKey": "software",
    "simplified": false,
    "style": "classic",
    "isPrivate": false,
    "properties": {}
  }
]

With the IssueType Problem (issueTypeID 10302) i am able to create a JIRA Ticket via the native JIRA Node.

BTW: I searched the Web for the Schema Description for the issueTypeID, in the end chatgtp tells me a Range of 1 to 10 digits, type number.
The n8n JIRA Node accepts minimum 2 digits for the issueTypeID. https://github.com/n8n-io/n8n/blob/master/packages/nodes-base/nodes/Jira/IssueDescription.ts

@Joffcom
Copy link
Member

Joffcom commented Feb 7, 2024

Hey @mathiasdaniel,

Yeah we were expecting higher so we need to change that regex, I am not sure why it isn't loading the list though. I will update that regex though and we can see if it changes anything.

@mathiasdaniel
Copy link
Author

@Joffcom thank you so much. n8n and the community are awesome.

@Joffcom
Copy link
Member

Joffcom commented Feb 7, 2024

@mathiasdaniel if I was to make a test image based on the PR above would you be able to give it a go in a test environment?

@mathiasdaniel
Copy link
Author

Hey @Joffcom sure, we only need the Release Tag for the docker build, at the moment we use latest. Thx.

@Joffcom
Copy link
Member

Joffcom commented Feb 7, 2024

@mathiasdaniel docker tag is n8nio/n8n:PR-8571-gh-8560 but I would recommend running it as a test instance rather than in your live instance.

@mathiasdaniel
Copy link
Author

mathiasdaniel commented Feb 9, 2024

Hey @Joffcom ,

we builded a test instance and tested the following execuions with the JIRA node:

JIRA Node, IssueType, select by ID 3 works - JIRA Ticket is created, JIRA Node Ouptut is fine as expected
JIRA Node, IssueType, select Liste Task (ID 3) works - JIRA Ticket is created, JIRA Node Ouptut is fine as expected

Thank you for your help

@Joffcom
Copy link
Member

Joffcom commented Feb 9, 2024

Hey @mathiasdaniel,

Perfect, in that case I will get the PR ready for review and we can look at merging it for the next release.

@Joffcom
Copy link
Member

Joffcom commented Feb 12, 2024

Hey @mathiasdaniel,

The change for this has been merged and will be generally available in the next release. For now I will get this closed.

@Joffcom Joffcom closed this as completed Feb 12, 2024
@janober
Copy link
Member

janober commented Feb 15, 2024

Fix got released with n8n@1.29.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants