Hello,
I had to install OpsGenie Edge Connector on our test Jira server but when I am trying to submit alert on OpsGenie side, I can't get Jira SD to make ticket from that alert. Communication works from OpsGenie (OG) to Jira SD server. This is part of the output.txt file:
WARNING:root:[createIssue] Could not execute at Jira Service Desk; response: b'{"errorMessages":[],"errors":{"components":"Component/s is required."}}' status code: 400
In the settings for that project there are fields which are needed for creation of the ticket. "Component/s" is there as hidden. I was not able to remove it completely. When I made it blank - didn't help
I tried to define "Component/s" on OG side but no success as well. I am still getting above warning.
Can you please help me get thru that error message so Jira SD could create tickets based on OG alerts?
Hi @pavol_cvincek01 !
If the Jira project and issue type you are sending alerts to have (non-standard) required fields (like a component), there are two main options for getting them filled:
content_params = {
"fields": {
"project": {
"key": project_key
},
"issuetype": {
"name": issue_type_name
},
"summary": queue_message.get("summary"),
"description": queue_message.get("description"),
"labels": [toLabel.replace("\\s", "")],
"components": [{
"id": component
}]
}
}
Hope this helps!
Hello Robert,
First of all, thanks a lot for your feedback. Option 1 is not suitable for us so I went for second one. I added "compoment" there as suggested but after I started OEC I could see there error saying " NameError: name 'component' is not defined". I tried to define it by adding "import component" on the top of the actionExecutor.py but another problem appeared - "ImportError: No module named 'component". It would be great if you would be able to advice with this as well.
Thank you in advance and have a nice day.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @pavol_cvincek01 !
The "component" I had included in that snippet was an example variable name, so there's no need to do any additional imports in the script.
You would need to define "component" somewhere in the script, or at least substitute it with your component ID:
content_params = {
"fields": {
"project": {
"key": project_key
},
"issuetype": {
"name": issue_type_name
},
"summary": queue_message.get("summary"),
"description": queue_message.get("description"),
"labels": [toLabel.replace("\\s", "")],
"components": [{
"id": "12345"
}]
}
}
Hope this helps clarify things a bit!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Robert
Yep, I used our value for component at first but no success as mentioned above. Afterwards I changed "id" to "name" and it finally works. Thanks a lot for that, it helped significantly.
Unfortunately now I can see this there:
"WARNING:root:[createIssue] Could not execute at Jira Service Desk; response: b'{"errorMessages":[],"errors":{"customfield_13040":"Field Customer Request Type is required.","customfield_15340":"Field Did It work in the past? is required."}}' status code: 400"
Field Customer Request Type should be "Alerts"
Field Did It work in the past? should be "Yes"
When I tried the same approach like for "components" I wasn't successful. Can you advice how the code should looks like?
Thanks in advance and have a nice day.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@pavol_cvincek01 I think you're on the right track by following the same process as the first field. My first guess is those fields might be a different "type" of custom field though, so the format in the API request may need to be modified.
This page has some great examples in the Creating an issue using custom fields section. I'd check the types of those custom fields and make sure they're using the format mentioned in those docs.
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.