You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I am using a service account and have the use case of creating ticket and comments on behalf of another user via REST API. Currently, I am unable to figure out any API example or way to do the same.
Hi @AVNISH ANAND -- Welcome to the Atlassian Community!
You may want to search in the developer community for ideas about this topic:
https://community.developer.atlassian.com/
Best regards,
Bill
Hey Bill, with all the due respect, that's a pretty useless answer as the general community is now so bloated and full of out-of-date answers that it is not particularly easy to find anything there.
For other people finding this question, here is how far I made it, maybe it will help somebody, or maybe somebody could kick me even further:
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-post describes vaguely how to create an issue.
1) First, follow the beginning of that description to get to a point where you have your user credentials
2) Then, replace the xxx with your actual values, and run:
curl --request GET \
--url 'https://xxx.atlassian.net/rest/api/3/issue/createmeta' \
--user 'xxx:xxx' \
--header 'Accept: application/json'
-> it will tell you what are the `issuetype.id`, `project.id` numbers you want in the next step.
3) Run
curl --request POST \
--verbose \
--url 'https://xxx.atlassian.net/rest/api/3/issue' \
--user 'xxx:xxx' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"update": {},
"fields": {
"summary": "Main order flow broken",
"issuetype": {
"id": "XXX"
},
"project": {
"id": "XXX"
},
"description": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "Order entry fails when selecting supplier.",
"type": "text"
}
]
}
]
},
"reporter": {
"id": "XXX"
},
"labels": [
"test"
]
}
}'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Update #1. Changing the `reporter.id` to `reported.email` makes the API call go through, and the issue is created, but the requester is Anonymous.
I could attempt to create the user, but that would definitely mean I need to use API key with significant access. I don't wish to use API key that can manage my Jira users.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jan, with "reporter.email" I get "anonymous" in the ticket
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jan Klan @Adrián Eduardo Giacometti Brussolo did you find a way to use the API to create tickets on-behalf of existing users?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.