Skip Menu |

This queue is for tickets about the JIRA-Client-Automated CPAN distribution.

Report information
The Basics
Id: 131856
Status: new
Priority: 0/
Queue: JIRA-Client-Automated

People
Owner: Nobody in particular
Requestors: johan.laenen+cpan [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: assign_issue does't work anymore because jira insists on using accountID
Date: Tue, 18 Feb 2020 09:43:05 +0100
To: bug-JIRA-Client-Automated [...] rt.cpan.org
From: Johan Laenen cpan <johan.laenen+cpan [...] gmail.com>
Hi there, Just a quick notification, because I noticed last week that the assign_issue call doesn't work anymore. Personal data that is used to identify users, such as the username and userKey, got removed from the REST APIs. Users are identified by their Atlassian account ID (accountId) instead. See https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/ . Instead of using assign_issue I do this instead $jira->update_issue( $issue->{key}, { "assignee" => { 'accountId' => $admin{'accountId'} } } ); $admin{'accountId'} is hardcoded. Jira::Client::Automated does not offer an easy way to find the accountId. Greetings, Johan
Subject: Re: [rt.cpan.org #131856] AutoReply: assign_issue does't work anymore because jira insists on using accountID
Date: Fri, 21 Feb 2020 09:36:03 +0100
To: bug-JIRA-Client-Automated [...] rt.cpan.org
From: Johan Laenen cpan <johan.laenen+cpan [...] gmail.com>
A quick draft of a search_accountId function, I use this as a workaround in my existing perl scripts: use JIRA::Client::Automated; package JIRA::Client::Automated; sub search_accountId { my ($self, $emailAddress) = @_; my $uri = $self->{auth_url} . 'user/search?username=' . $emailAddress . '&fields=accountId'; my $request = GET $uri, Content_Type => 'application/json'; my $response = $self->_perform_request($request); my $results = $self->{_json}->decode($response->decoded_content()); my $data_ref = @{$results}[0]; die "something went wrong while searching for $emailAddress" if ($data_ref->{emailAddress} ne $emailAddress); return $data_ref->{accountId}; } greetings, Johan
Subject: Re: [rt.cpan.org #131856] AutoReply: assign_issue does't work anymore because jira insists on using accountID
Date: Wed, 15 Apr 2020 08:16:17 +0200
To: bug-JIRA-Client-Automated [...] rt.cpan.org
From: Johan Laenen cpan <johan.laenen+cpan [...] gmail.com>
Atlassian changed its jira api again between the 14th of April 2020 and the 15th of April 2020: 'user/search?username=' . $emailAddress . '&fields=accountId'; became 'user/search?query=' . $emailAddress . '&fields=accountId'; I had to adapt my search_accountId method: use JIRA::Client::Automated; package JIRA::Client::Automated; sub search_accountId { my ($self, $emailAddress) = @_; my $uri = $self->{auth_url} . 'user/search?query=' . $emailAddress . '&fields=accountId'; my $request = GET $uri, Content_Type => 'application/json'; my $response = $self->_perform_request($request); my $results = $self->{_json}->decode($response->decoded_content()); my $data_ref = @{$results}[0]; die "something went wrong while searching for $emailAddress" if ($data_ref->{emailAddress} ne $emailAddress); return $data_ref->{accountId}; } Greetings, Johan