Skip to content

Conversation

@Ice3man543
Copy link
Member

@Ice3man543 Ice3man543 commented Dec 18, 2025

Proposed changes

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Summary by CodeRabbit

  • New Features
    • Added optional SiteURL configuration option to override default Jira issue URLs, enabling custom domain configurations and improved OAuth compatibility.

✏️ Tip: You can customize this high-level summary in your review settings.

@auto-assign auto-assign bot requested a review from Mzack9999 December 18, 2025 11:34
@Ice3man543 Ice3man543 self-assigned this Dec 18, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2025

Walkthrough

The Jira tracker integration was refactored to convert a package-level function into an instance method while adding a configurable SiteURL option to override browsable issue URLs, ensuring URL construction logic conditionally uses the provided SiteURL or falls back to the original behavior.

Changes

Cohort / File(s) Summary
Jira Tracker Configuration & URL Handling
pkg/reporting/trackers/jira/jira.go
Added optional SiteURL field to Options struct for custom issue URL generation; refactored getIssueResponseFromJira from package-level function to Integration instance method; updated URL construction to build issue URLs as <SiteURL>/browse/<IssueKey> when SiteURL is provided, otherwise preserves original logic using issue.Self path mapping; updated all call sites to invoke the new method.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify all call sites have been updated from package-level function to instance method invocation
  • Confirm URL construction logic correctly handles both the SiteURL override case and the fallback path

Poem

🐰 A Jira hop, now cleaner still,
One function joins the Integration's will,
With custom URLs, the URLs align,
The rabbit's refactor, oh so fine!
Better browsin', hop by hop,
This Jira patch will never stop! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The pull request title accurately describes the main change: adding a site-url configuration option to the Jira tracker Options struct to optionally provide a Jira server URL for OAuth scenarios.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-jira-issue-url

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
pkg/reporting/trackers/jira/jira.go (1)

355-377: Consider adding tests for the new SiteURL functionality.

While the implementation is sound, the PR checklist indicates tests haven't been added yet. Consider adding unit tests to verify:

  • URL construction when SiteURL is provided
  • Fallback behavior when SiteURL is empty
  • Proper handling of trailing slashes in SiteURL

Would you like me to help generate test cases for this functionality?

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c80ac99 and b90a32e.

📒 Files selected for processing (1)
  • pkg/reporting/trackers/jira/jira.go (3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.go

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.go: Format Go code using go fmt ./...
Run static analysis using go vet ./... on Go code

Files:

  • pkg/reporting/trackers/jira/jira.go
pkg/reporting/**/*.go

📄 CodeRabbit inference engine (CLAUDE.md)

Result export and issue tracking integrations should be implemented in pkg/reporting/

Files:

  • pkg/reporting/trackers/jira/jira.go
🧬 Code graph analysis (1)
pkg/reporting/trackers/jira/jira.go (4)
pkg/reporting/trackers/gitlab/gitlab.go (1)
  • Integration (17-21)
pkg/reporting/trackers/github/github.go (1)
  • Integration (23-26)
pkg/reporting/trackers/gitea/gitea.go (1)
  • Integration (19-22)
pkg/reporting/trackers/filters/filters.go (1)
  • CreateIssueResponse (13-16)
🔇 Additional comments (4)
pkg/reporting/trackers/jira/jira.go (4)

187-189: Well-documented optional field addition.

The SiteURL field is properly documented with a clear use case for OAuth scenarios. The YAML and JSON tags follow the existing conventions in the codebase.


355-377: Solid implementation with proper fallback logic.

The conversion from package-level function to instance method follows the pattern used in other tracker integrations. The conditional URL construction logic is clean and maintains backward compatibility when SiteURL is not configured.


352-352: Correctly updated to instance method.

The call site properly invokes the refactored instance method with the appropriate argument type.


392-392: Correctly updated to instance method.

The call site properly invokes the refactored instance method with the appropriate argument type.

Adds optional `site-url` field to JIRA issue
tracker configuration for specifying browsable URL
when it differs from the API endpoint. This is
particularly useful for OAuth-based JIRA Cloud
integrations where `issue.Self` contains
"api.atlassian.com" instead of the user-facing
domain.

Signed-off-by: Dwi Siswanto <[email protected]>
@dwisiswant0 dwisiswant0 changed the title feat: add site-url to optionally provide jira server URL for oauth feat(trackers): add site-url to optionally provide jira server URL for oauth Dec 18, 2025
@dwisiswant0 dwisiswant0 added this to the v3.6.2 milestone Dec 18, 2025
@projectdiscovery projectdiscovery deleted a comment from coderabbitai bot Dec 18, 2025
@dwisiswant0
Copy link
Member

@coderabbitai create an issue for this PR.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2025

Tip

For best results, initiate chat on the files or code changes.

@dwisiswant0, I'd be happy to create an issue for this PR! However, I need a bit more information to create a meaningful issue:

  • What should the issue be about?
  • Is this for tracking follow-up work related to this PR?
  • Should it track something that needs to be completed before merging?
  • Or is there a specific concern or feature request you'd like documented?

Please provide details about what you'd like the issue to contain (title, description, and any specific points to include), and I'll create it for you.

@dwisiswant0
Copy link
Member

Tip

For best results, initiate chat on the files or code changes.

@dwisiswant0, I'd be happy to create an issue for this PR! However, I need a bit more information to create a meaningful issue:

  • What should the issue be about?
  • Is this for tracking follow-up work related to this PR?
  • Should it track something that needs to be completed before merging?
  • Or is there a specific concern or feature request you'd like documented?

Please provide details about what you'd like the issue to contain (title, description, and any specific points to include), and I'll create it for you.

@coderabbitai as in the changes.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Get PR details and the diff to understand the changes better
gh pr view 6716 --json title,body,author,number,url,files

# Get the actual diff to see what changed
gh pr diff 6716 --patch

Length of output: 5857


🏁 Script executed:

#!/bin/bash
# Create a GitHub issue for this feature based on the PR changes
gh issue create \
  --title "Add optional site-url configuration for Jira OAuth integrations" \
  --body "## Description

This issue tracks the enhancement to support custom browsable URLs for Jira issue tracker integrations, particularly useful for OAuth-based Jira Cloud setups.

## Problem

When using OAuth with Jira Cloud, the \`issue.Self\` field returned by the API contains \`api.atlassian.com\` instead of the user-facing domain (e.g., \`your-company.atlassian.net\`). This results in incorrect issue URLs being generated for browsing.

## Solution

Add an optional \`site-url\` configuration field that allows users to specify the browsable URL for their Jira instance. When provided, this URL is used to construct issue browse links instead of deriving them from \`issue.Self\`.

## Changes

- Add \`SiteURL\` field to Jira \`Options\` struct
- Update URL construction logic to use \`SiteURL\` when available
- Fall back to original \`issue.Self\` logic when \`SiteURL\` is not provided
- Include configuration example in \`issue-tracker-config.yaml\`

## Implementation

PR #6716: https://github.com/projectdiscovery/nuclei/pull/6716

## Requester

@dwisiswant0" \
  --assignee "dwisiswant0"

Length of output: 54


@dwisiswant0, I've created the issue for this PR: #6717

The issue documents the feature enhancement to add optional site-url configuration for Jira OAuth integrations, describing the problem it solves (incorrect URLs with api.atlassian.com in OAuth scenarios) and the solution implemented in this PR. The issue has been assigned to you.

@dwisiswant0 dwisiswant0 linked an issue Dec 18, 2025 that may be closed by this pull request
@dwisiswant0 dwisiswant0 merged commit d48c2c3 into dev Dec 18, 2025
19 checks passed
@dwisiswant0 dwisiswant0 deleted the fix-jira-issue-url branch December 18, 2025 16:47
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.

Add optional site-url configuration for Jira OAuth integrations

4 participants