Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Unable to open JIRA ticket using API integration

Udi Ben Hamo January 25, 2024

Hi All,

 

Background:

On my company's platform, there is a built-in integration with JIRA.

It should open a JIRA ticket whenever an alert is triggered on our product.

 

Issue:

I configured the integration using my own email, an API token, configured the JIRA host and project key.

I simulated an alert- and a ticket was created.

 

Then i created a new email user- a generic one for the sake of the alert report.

The user was given project admin role, admin org permission and in general the same permissions as my own user.

I created a new API token and configured similar parameters - however when i simulated an alert, the following error appeared:

Client request(POST https://<host>.atlassian.net/rest/api/2/issue\) invalid: 400 Bad Request. Text: "{"errorMessages":[],"errors":{"reporter":"Specify a valid value for reporter","assignee":"Specify a valid value for assignee

 

Again,

Same permissions were granted, same configuration was performed.

 

In addition,

I tried to open a ticket using curl command with the exact same permissions and it worked!

 

curl -D- -u <USER:API TOKEN> -X POST -H "Content-Type: application/json" \
--data '{
"fields": {
"project": {
"key": "<PROJECT KEY>"
},
"summary": "Issue Summary",
"description": "Issue Description",
"issuetype": {
"name": "Task"
}
}
}' "https://<HOST>.atlassian.net/rest/api/2/issue/"

 

I would appreciate your assistance with identifying the issue.

 

Thanks,

Udi

2 answers

0 votes
Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 26, 2024

Hi @Udi Ben Hamo ,

Welcome to the community!

Did you use the new account to create a ticket via the UI in the project you've specified in the JSON? If not please try, you probably run into the same error

Looking at the error message the new account may not be the reporter (which implies that it is missing the create issues permission). The other error implies that an assignee should be set (take a look at the field configuration is assignee is required). 

Rudy

Udi Ben Hamo January 27, 2024

Hi Rudy,

Thank you!!

 

I am able to open a ticket using the UI with the same user.

As i mentioned in the ticket description- i'm also able to open a ticket using a simple API call.

 

I also have the 'create issue' permission.

I've checked the permissions of the problematic user and my user- both have the exact same permissions.

 

Thanks,

Udi

0 votes
Carlos Faddul
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 25, 2024

@Udi Ben Hamo , how are you ?

 

Are you using a existing email or atlassian ID in reporter and assignee ?

 

Normally, in API's i use Atlassian ID to set the users (in CSV file works no problems with emails LOL)

 

Try to use the Atlassian Account ID for the Rest

Udi Ben Hamo January 27, 2024

Hi Carlos,

 

In our code- we map both the assignee and reporter as accountID.

It works properly on my user, i just can't seem to find the difference.

 

Thanks,

Udi

Like Marco Bambili likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events