The API seems to work correctly. If I switch to another user that is not a project administrator or incognito mode, it fails.
I get this data from the API string. {"data":[{"id":17234,"mailChannelId":11,"mailItemId":17234,"handlerName":"Service project Mail Handler","resultStatus":"FAILED","message":"Current user is not active","fromAddress":"inactiveuser@jira.nu","mailChannelName":"emailchannel@jira.nu","subject":"Sv: Radera domän","issueKey":"","noOfRetry":0,"updatedDateTime":"2024-11-28 09:34","createdDateTime":"2024-11-28 09:34"},{"id":17227,"mailChannelId":11,"mailItemId":17227,"handlerName":"Service project Mail Handler","resultStatus":"FAILED","message":"Current user is not active","fromAddress":"inactiveuser@jira.nu","mailChannelName":"emailchannel@jira.nu","subject":"Radera domän","issueKey":"","noOfRetry":0,"updatedDateTime":"2024-11-28 06:27","createdDateTime":"2024-11-28 06:27"}],"totalPages":1}
If the API works then your command is correct. So, the issue must be 'permission' related, since you mention switching to another user.
The API authentication token you use represents the "user". So, to access the project and it's settings, you need to make sure the user has proper access in the project. They'll need a JSM license, be a role member, and have permissions that allow them the access (e.g., Project Admin). I can't remember if they need to actually be a Jira admin. I don't think so.
We created a special service account and use this for the user. This way we can assign access that is separate from our admins, for tracking and so things don't break when people change roles or leave the company.
Does this work if you create and use your own API key? You might want to create a test user and create an API key for it and try it with that. It sounds like you have things right, but just need to work out the user permissions, as described above.
Does this article apply to Jira data center, or is it just for Jira cloud?
I've tried with my own user (global Jira administrator) and API key, and the automation still keeps failing. If I paste the URL into my browser, it returns the correct data.
If I switch to Bearer instead of Basic and my access token, the automation "succeeds", but the webhook returns no data (I tried changing from true to false) and the e-mail that got sent was empty.
@Mark B Wager We finally got everything to work * We switched to usingBearer instead of Basic * Instead of API key, we are using Personal Access Tokens * "webhookResponse" instead of "webResponse"
Be sure you re-read the thread instructions carefully. The {{epochtimestamp}} is NOT a function, it is a VARIABLE that is being created and then used as a filter in the URL. You can see my example usage in my earlier comment here.
You're getting this error because it can't find the defined variable (which you can name anything you want). Try adding a variable with the value Yuri or I suggest. And, you don't need to use the variable/filter at all, unless you're trying to return only a certain range based on a time frame.
34 comments