You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for this to work, I extended your package with a 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};
}
The text was updated successfully, but these errors were encountered:
See https://rt.cpan.org/Public/Bug/Display.html?id=131856 where I logged this issue.
The problem is, 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' =>
$jira->search_accountId($bpostcentraluser) }});
for this to work, I extended your package with a 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};
}
The text was updated successfully, but these errors were encountered: