adrian-soomro / jira-commenter

AzDo build extension that comments on your JIRA tickets.
GNU General Public License v3.0
1 stars 1 forks source link

jira on prem server supported? #15

Open danmorgen opened 2 years ago

danmorgen commented 2 years ago

hi can it work with jira server? how to connect? thanx

adrian-soomro commented 2 years ago

Hi,

I'm not very familiar with Jira Server on prem offering.

However, as long as these prerequisites are met, I think the extension should work just the same. 1) The on prem version provides the same REST API, mainly the comment resource 2) If 1) is available with auth, make sure you have a way to generate an API token for the aforementioned API 3) The Rest API is either public, or the azure build agent that will be running the task can resolve its location

2)+ If the on prem offering comes with a REST API that doesn't need auth, you should be fine by passing a string of alphanumeric characters to the 'token' required field of the task.

Hope that helps 😄

danmorgen commented 2 years ago

Hi

Tnx for quick reply

My problem is "organisation"

I have url. No organization. On prem

On Thu, Apr 28, 2022, 15:28 Adrian Soomro @.***> wrote:

Hi,

I'm not very familiar with Jira Server on prem offering.

However, as long as these prerequisites are met, I think the extension should work just the same.

  1. The on prem version provides the same REST API, mainly the comment resource
  2. If 1) is available with auth, make sure you have a way to generate an API token for the aforementioned API
  3. The Rest API is either public, or the azure build agent that will be running the task can resolve its location

2)+ If the on prem offering comes with a REST API that doesn't need auth, you should be fine by passing a string of alphanumeric characters to the 'token' required field of the task.

Hope that helps 😄

— Reply to this email directly, view it on GitHub https://github.com/adrian-soomro/jira-commenter/issues/15#issuecomment-1112143268, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK3RM4YFYYAXMROIRGVSDGLVHJ77DANCNFSM5URVOUMA . You are receiving this because you authored the thread.Message ID: @.***>

adrian-soomro commented 2 years ago

I see, where is the comment resource located?

The way to get to a cloud one is as follows

 const url = `https://${organisation}.atlassian.net/rest/api/2/issue/${project}-${ticketNumber}/comment`

I assume (correct me if I'm wrong) that the API is running on a URL that'd look something like https://host.address/rest/api/2/ if that's the case, you could edit the hosts file on the build agent and add an entry where host.address.atlassian.net would resolve to host.address, allowing you to pass host.address as the organisation.

danmorgen commented 2 years ago

Thanks, I'll try it out

On Thu, Apr 28, 2022, 23:52 Adrian Soomro @.***> wrote:

I see, where is the comment resource located?

The way to get to a cloud one is as follows

const url = https://${organisation}.atlassian.net/rest/api/2/issue/${project}-${ticketNumber}/comment

I assume (correct me if I'm wrong) that the API is running on a URL that'd look something like https://host.address/rest/api/2/ if that's the case, you could edit the hosts file on the build agent and add an entry where host.address.atlassian.net would resolve to host.address, allowing you to pass host.address as the organisation.

— Reply to this email directly, view it on GitHub https://github.com/adrian-soomro/jira-commenter/issues/15#issuecomment-1112643753, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK3RM4YIHDFJRPIZSZE6LC3VHL27RANCNFSM5URVOUMA . You are receiving this because you authored the thread.Message ID: @.***>

danmorgen commented 2 years ago

Hi

Tried that.

Added entry in hosts file, so myjiraonprem.atlassian.net is valid

The problem is that token not supported on jira on prem.

Oath or basic authentication only

Suggestions?

Dan

On Fri, Apr 29, 2022, 16:08 Dan Morgenstern @.***> wrote:

Thanks, I'll try it out

On Thu, Apr 28, 2022, 23:52 Adrian Soomro @.***> wrote:

I see, where is the comment resource located?

The way to get to a cloud one is as follows

const url = https://${organisation}.atlassian.net/rest/api/2/issue/${project}-${ticketNumber}/comment

I assume (correct me if I'm wrong) that the API is running on a URL that'd look something like https://host.address/rest/api/2/ if that's the case, you could edit the hosts file on the build agent and add an entry where host.address.atlassian.net would resolve to host.address, allowing you to pass host.address as the organisation.

— Reply to this email directly, view it on GitHub https://github.com/adrian-soomro/jira-commenter/issues/15#issuecomment-1112643753, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK3RM4YIHDFJRPIZSZE6LC3VHL27RANCNFSM5URVOUMA . You are receiving this because you authored the thread.Message ID: @.***>

adrian-soomro commented 2 years ago

If I understand this correctly, using the basic flow auth has the same flow as authing using an API token. Based on on-prem auth header construction docs vs how we construct the auth header I'd try substituting the accessToken with your account's password and emailAddress with your account's username (if they differ)

danmorgen commented 2 years ago

Thanks

On Sat, May 14, 2022, 01:47 Adrian Soomro @.***> wrote:

If I understand this correctly, using the basic flow auth has the same flow as authing using an API token. Based on on-prem auth header construction docs https://developer.atlassian.com/server/jira/platform/basic-authentication/#construct-the-authorization-header vs how we construct the auth header https://github.com/adrian-soomro/jira-commenter/blob/main/buildandreleasetask/commenter.ts#L49 I'd try substituting the accessToken with your account's password and emailAddress with your account's username (if they differ)

— Reply to this email directly, view it on GitHub https://github.com/adrian-soomro/jira-commenter/issues/15#issuecomment-1126559727, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK3RM42L7NHDHBBABCNS3ADVJ3LWHANCNFSM5URVOUMA . You are receiving this because you authored the thread.Message ID: @.***>

adrian-soomro commented 2 years ago

Did that work?

danmorgen commented 2 years ago

no

On Wed, May 18, 2022 at 12:18 AM Adrian Soomro @.***> wrote:

Did that work?

— Reply to this email directly, view it on GitHub https://github.com/adrian-soomro/jira-commenter/issues/15#issuecomment-1129326778, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK3RM4ZLSANNOJ6VRCNPFT3VKQEKJANCNFSM5URVOUMA . You are receiving this because you authored the thread.Message ID: @.***>

adrian-soomro commented 2 years ago

Is there anything useful in the logs?

danmorgen commented 2 years ago

It still demands email. Username not valid

Please. Try it via jira on prem

On Sun, May 22, 2022, 18:36 Adrian Soomro @.***> wrote:

Is there anything useful in the logs?

— Reply to this email directly, view it on GitHub https://github.com/adrian-soomro/jira-commenter/issues/15#issuecomment-1133921584, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK3RM46MD7CAUDDIRYEEGT3VLJIBHANCNFSM5URVOUMA . You are receiving this because you authored the thread.Message ID: @.***>