feat: Add JiraClient and OpenTelemetry URL helpers#53
Open
Conversation
Adds two new utility modules required by the AutoEscalation feature: - Zexbox.JiraClient: Req-based client for the Jira Cloud REST API v3. Supports search, create, transition, and add_comment operations. Authenticates via JIRA_USER_EMAIL_ADDRESS / JIRA_API_TOKEN env vars or :jira_email / :jira_api_token application config. - Zexbox.OpenTelemetry: Reads the current process OTEL context (baggage and active span) to produce Datadog session, Grafana Tempo trace, and Kibana Discover URLs. Returns nil gracefully when OTEL is unconfigured. Adds :req, :jason, and :opentelemetry_api dependencies to mix.exs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced Mar 3, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…uests search_latest_issues was using GET with query params, which means the response body was not guaranteed to be JSON-decoded by Req (Req only auto-decodes based on the response Content-Type, not the request method). Two changes: - search_latest_issues now uses POST /rest/api/3/search/jql with a JSON body — the preferred Jira v3 approach. This also allows fields to be sent as a proper JSON array rather than a comma-separated string. - build_client adds Accept: application/json to every request so the remaining GET (transitions fetch) also explicitly signals JSON intent and Req's decode_body step has a clear content-type to act on. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces keyword list opts (Keyword.fetch!/get) with typed positional
arguments throughout, consistent with the rest of the repo's style:
search_latest_issues(jql, project_key \\ nil)
create_issue(project_key, summary, description, issuetype, priority, custom_fields \\ %{})
transition_issue(issue_key, status_name)
add_comment(issue_key, comment)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Jez-A
commented
Mar 3, 2026
| ``` | ||
| """ | ||
|
|
||
| @production_tempo_uid "een1tos42jnk0d" |
Author
There was a problem hiding this comment.
uid taken from our Ruby equivalent: https://github.com/Intellection/opsbox/blob/664f2279166a0b6cefdf479caa308b8eacbf41df/lib/opsbox/opentelemetry/opentelemetry.rb#L49
Jez-A
commented
Mar 3, 2026
| @@ -0,0 +1,148 @@ | |||
| defmodule Zexbox.OpenTelemetry do | |||
Author
There was a problem hiding this comment.
Those methods will be called in a subsequent PR: https://github.com/Intellection/zexbox/pull/54/changes#diff-f51eafc4c4596d3e2ee95a3fef46c8534d5da59ec071d34d01302188ccba021fR84
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is a port of the Jira client we currently have in Opsbox: https://github.com/Intellection/opsbox/blob/master/lib/opsbox/jira_client.rb
We're also adding the OTEL URL helpers.
PR: #52 Adds the public entry point to handling errors.
PR: #54 adds the ADFBuilder which builds Atlassian Document Format (ADF) maps for Jira issue descriptions and comments.
The planned merge order is 53 (this PR) then 54, then 52.
Changes
Zexbox.JiraClient: Req-based HTTP client for the Jira Cloud REST API v3 (search, create issue, transition, add comment)Zexbox.OpenTelemetry: reads the current OTEL span/baggage to produce Datadog session, Grafana Tempo, and Kibana Discover URLs — returnsnilgracefully when OTEL is unconfigured:req,:jason, and:opentelemetry_apidependenciesThese two modules are the infrastructure layer for the AutoEscalation feature (see follow-up PRs).
Test plan
mix test test/zexbox/jira_client_test.exs— 10 tests covering all four public JiraClient functionsmix test— full suite green🤖 Generated with Claude Code