Integration of Opsgenie with JSM
Asked by balajisk:

Hi All,

I have integrated Opsgenie with JSM for a particular project in JSM. Now myself started receiving alerts in opsgenie for all the incidents but it is always tagged as Priority P3. Also i want to set the rule to create alert only if Incident in JSM is priority 1. Kindly advise.

Thanks \& Regards

Balaji.S


Answers:
author: Samir
body: Hi [@balajisk](/t5/user/viewprofilepage/user-id/4807507) ,

Could you clarify which integration you are using between Opsgenie and JSM? We have a few options now. The [most common one](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&ved=2ahUKEwiI29jLmr72AhV0gnIEHZUFC1kQFnoECAoQAQ&url=https%3A%2F%2Fsupport.atlassian.com%2Fopsgenie%2Fdocs%2Fintegrate-opsgenie-with-jira-service-management%2F&usg=AOvVaw1uab4aE1yP7vIufj8-LUnt) involves configuring a webhook in JSM to send the issues to Opsgenie? If so - you have a couple of options for setting it up so that only JSM incidents with priority = P1 will create alerts in Opsgenie.

1. In the webhook you created in JSM that sends incidents to Opsgenie, you can use JQL to to specify a query so that only incidents with priority = P1 are sent to Opsgenie![2022-03-11_08-55-19.png](https://community.atlassian.com/t5/image/serverpage/image-id/187744i70E007B919D9C13D/image-size/large?v=v2&px=999 "2022-03-11_08-55-19.png")  

2. Alternatively depending on your Opsgenie plan, if you have access to "Advanced" view of integrations, you can filter on the JSM integration in Opsgenie to specify which issues from JSM should create Opsgenie alerts![2022-03-11_08-57-05.png](https://community.atlassian.com/t5/image/serverpage/image-id/187745i1CE2FBF05A643951/image-size/large?v=v2&px=999 "2022-03-11_08-57-05.png")  

   You can also specify that the alerts created in Opsgenie from JSM should have priority = P1  
   ![2022-03-11_08-58-02.png](https://community.atlassian.com/t5/image/serverpage/image-id/187747i7DC7DFE8B199B418/image-size/large?v=v2&px=999 "2022-03-11_08-58-02.png")

Hope this helps!

Thanks,

Samir

comments: author: balajisk
body: Thanks Samir for your reply, currently I have not tried using web hook and also advanced option not visible for me. Hence myself trying integration under Teams section in Opsgenie. Need to check on web hook.

Thanks for your immediate suggestions.


author: balajisk
body: Hi Samir,

Thanks for your support. Now using Webhooks myself able to send only Priority 1 alerts to Opsgenie.

Now, facing the problem in sending back responses to JSM. I have configured JIRA URL/Username/Password in Opsgenie to Jira Service Management Tabs. Below error myself getting.,

401 Unauthorized: \[Basic authentication with passwords is deprecated. For more information

May be i need to use API Token, not sure where to generate, if you can suggest, it helps.

Myself also going through the articles.


author: Samir
body: Hi [@balajisk](/t5/user/viewprofilepage/user-id/4807507) ,

Yes, you need to generate an API token to use for authentication. You can do so according to this page: <https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/>


author: balajisk
body: Thanks Samir for your reply and support, I have gone through this link and API authentication was success. But was getting below error. Kindly advise.

Could not send \[resolveIssue\] action to JiraServiceDesk \[OG-Network_Jira Service Management\]. Reason: Cannot get transition id. Reason: 404 Not Found: \[{"errorMessages":\["Issue does not exist or you do not have permission to see it."\],"errors":{}}\]


author: Samir
body: [@balajisk](/t5/user/viewprofilepage/user-id/4807507) This means Opsgenie is trying to "Resolve" the JSM issue. When it does this, it makes an API request to list all transitions that will move the issue to a status of "Resolved".

this error indicates that for this particular issue type in your JSM instance, there are ***no***transitions available that will move the issue to a status of "Resolved".

You will want to look into the workflows/transitions you have configured for this issue type. You can follow this guide: <https://support.atlassian.com/jira-cloud-administration/docs/work-with-issue-workflows/>

If you have further questions, I'd recommend reaching out to support via support.atlassian.com and we can assist you further.


author: balajisk
body: Thanks, I will check on this. Yes I have already opened one case and working with support team. Thanks once again.