Skip to content

Conversation

@waltherlee
Copy link
Member

#4159 enabled templating for Jira config fields project and issue_type by rendering the templates in the request body sent to create the issue:

However, it doesn't render the value in a previous request that checks if the Jira issue already exists, throwing the error:

notify retry canceled due to unrecoverable error after 1 attempts:
failed to look up existing issues: HTTP request to JIRA API: 
unexpected status code 400:
{"errorMessages":["The value '{{ .CommonLabels.project }}' does not exist for the field 'project'."],"warningMessages":[]}

This change adds the same template function to render the project value in the search request as well.

Signed-off-by: Walther Lee <walther.lee@reddit.com>
@waltherlee waltherlee force-pushed the fix-jira-lookup-query-for-templated-values branch from 7cc9efa to e6924fc Compare March 3, 2025 22:53
Signed-off-by: Walther Lee <walther.lee@reddit.com>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is some weird stuff happening in the tests, but it looks like they have been copied from the existing tests. We can clean those up later.

Copy link
Member Author

@waltherlee waltherlee Mar 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I know what you mean: the testcase overwriting a variable used in the server handler. I copied that, but I'm working on another PR and noticed that there's another test in this file that just sets up the handler inside the testcase. I'll change it here

Copy link
Collaborator

@grobinson-grafana grobinson-grafana Mar 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine, I would prefer if you do that in another PR actually, as I've reviewed this as is and asked for it to be merged.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, will do. Thanks again

Copy link
Member

@gotjosh gotjosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gotjosh gotjosh merged commit 05e380a into prometheus:main Mar 6, 2025
11 checks passed
This was referenced Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants