Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Support for Jira Data Center #576

Open
jakauppila opened this issue May 6, 2024 · 7 comments
Open

[Feature Request]: Support for Jira Data Center #576

jakauppila opened this issue May 6, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@jakauppila
Copy link

Description

We would love to utilize the Jira functionality but found that it does not support Jira Data Center as we self-host our Jira cluster.
It would be great if support could be added for Jira Data Center alongside Cloud.

Describe the solution you'd like

The primary difference I see between the two is that Jira Data Center can utilize Personal Access Tokens when interacting with the API: https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html

Describe alternatives you've considered

No response

@jakauppila jakauppila added the enhancement New feature or request label May 6, 2024
@StevenWeathers
Copy link
Owner

It is my understanding that Atlassian is retiring support of self-hosted Jira instances, let me know if I'm incorrect.

@StevenWeathers
Copy link
Owner

See https://www.atlassian.com/migration/assess/journey-to-cloud which means that server instances will no longer receive security updates. Given this I would not support an End of Life product directly, if the functionality desired is available on cloud and would also work on server I'm open to a PR.

@StevenWeathers StevenWeathers added the wontfix This will not be worked on label Jul 18, 2024
@jakauppila
Copy link
Author

Atlassian retired the single-instance Server licenses but still plan to support the clustered On-prem Data Center licenses.

@StevenWeathers
Copy link
Owner

Thanks for the clarification, I'm open to supporting data center if it remains supported by Atlassian. I will take a look at what it will require to make the authentication and configuration work.

@StevenWeathers StevenWeathers removed the wontfix This will not be worked on label Jul 19, 2024
@pschaub
Copy link

pschaub commented Nov 19, 2024

The Data Center product will still be supported. That because Atlassian is writing on their website "Upgrade to Data Center".

@chse1713
Copy link

Hello,

We did a reference implementation for the Jira data center integration with the library go-jira.
According to my research, the library go-atlassian isn't supporting a data center login.

Here are some code snippets:

client.go

package jira

import (
	jira "github.com/andygrunwald/go-jira/v2/onpremise"
)

// New creates a new JIRA client
func New(config Config) (*Client, error) {
	tp := jira.BearerAuthTransport{
		Token: config.AccessToken,
	}
	instance, err := jira.NewClient(config.InstanceHost, tp.Client())
	if err != nil {
		return nil, err
	}

	return &Client{
		instance: instance,
	}, nil
}

stories.go

package jira

import (
	"context"

	jira "github.com/andygrunwald/go-jira/v2/onpremise"
)

func (c *Client) StoriesJQLSearch(ctx context.Context, jql string, fields []string, startAt int, maxResults int) (*IssuesSearchResult, error) {
	iss := IssuesSearchResult{}
	opt := &jira.SearchOptions{
		MaxResults: maxResults, // Max results can go up to 1000
		StartAt:    startAt,
	}
	issues, respo, err := c.instance.Issue.Search(ctx, jql, opt)
	if err != nil {
		return nil, err
	}
	iss.Total = respo.Total
	iss.Issues = issues

	return &iss, err
}

types.go

package jira

import (
	jira "github.com/andygrunwald/go-jira/v2/onpremise"
)

// Config is the configuration for the Jira client
type Config struct {
	InstanceHost string `json:"instance_host"`
	AccessToken  string `json:"access_token"`
	ClientMail   string `json:"client_mail"`
}

// Client is the Jira client
type Client struct {
	instance *jira.Client
}

// IssuesSearchResult is the result of a search for issues
type IssuesSearchResult struct {
	Total  int          `json:"total"`
	Issues []jira.Issue `json:"issues"`
}

This sample works fine with the import via JQL, and we tested it with Atlassion Jira 9.15.x.

An e-mail address isn't needed for the on-prem data center login, only the token.

I think the only thing that is needed is some sort of switch in the UI to cover booth cases.

Furthermore, we also improved the description output (maybe this can also be used in Atlassion cloud):

We used a library jira2md.

JQLImport.svelte

import {jira_to_html } from 'jira2md';
.
.
.
description: jira_to_html(story.fields.description),

This renders the Jira description output into HTML and gives a nice looking output.

@StevenWeathers
Copy link
Owner

I would gladly accept a PR to support on prem as long as it maintains the cloud support as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants