Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Viewing linked Jira issues in Bamboo

Artsiom_Tverdakhleb May 20, 2019

We are using a Bamboo script task to update linked Jira tickets.

We have tech users locally in both systems and use them to do REST calls.

Recently all automation fell down, as it was asking Bamboo tech user to log in to Jira, to be able to see linked issues.

Why that could have happened?

Is there a way to avoid this?

Is it possible to connect users using a code, not UI? 

1 answer

1 accepted

0 votes
Answer accepted
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 22, 2019

Hello @Artsiom_Tverdakhleb

Let me add some comments on your messages to make sure we are aligned.

We are using a Bamboo script task to update linked Jira tickets.

We have tech users locally in both systems and use them to do REST calls.

I assume you are using username and password for that, right?

Recently all automation fell down, as it was asking Bamboo tech user to log in to Jira, to be able to see linked issues.

What was the error you saw in Bamboo script?

Why that could have happened?

If the requests were without password, it might be the case of a permission change in Jira side for the affected user.

Is there a way to avoid this?

I'll need to make sure I understand the problem correctly first. I would start checking:

  1. How is the REST API called
  2. What is the error you see in Bamboo side
  3. What are the permissions for the user in Jira side

Is it possible to connect users using a code, not UI? 

When you say connect, are you talking about login? I guess I will need the data shared above to understand better what is happening there.

Artsiom_Tverdakhleb May 23, 2019

Hello @Daniel Santos,

Thank you for your reply.

 

I assume you are using username and password for that, right?

Yes, that's right. 

What was the error you saw in Bamboo script? 

That was 401, but not actually from Bamboo. You see, the REST API we were calling is: 

/result/{projectKey}-{buildKey}-{buildNumber : ([0-9]+)|(latest)}?expand=jiraIssues

So that request was actually returning 401 from Jira. As any other requests to Bamboo were returning the correct information. For example this call:

/deploy/projectVersioning/{deploymentProjectId}/variables

From the above, I decided to log in into Bamboo with tech user. In the UI on the linked issues page in the Build plan, I saw that it was asking to log in into Jira to see linked issues. So somehow Bamboo or Jira is connecting this both users.

 

Hope this information would answer your questions.

Regards, Artsiom

Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 23, 2019

Now that I reproduced the issue I can tell you what possibly happened.
One of the possible causes for this was the application links recreation.

I suppose that when you (or your team) created the application link the option  "[] servers have the same set of users and usernames" was not checked. Considering the scenario where the base of users is possibly different, the Atlassian apps will use a token to identify which user is linked to which user. In other words, when I access with user A, Bamboo will use the user B (that was linked to A) to access Jira. In your case, these users have possibly the same name.

When the application links are created as described above we have to link at least one time the pair of users and this will happen when receiving a message requesting you to log in, then Allow the linking. Once that is done you don't need to redo it unless:

  • The approval was removed in one of the apps
  • Or, the application link was recreated. When this happens the users will need to be linked again.

Does that make sense to you?

Artsiom_Tverdakhleb May 27, 2019

Hello @Daniel Santos,

Yes, thank you a lot.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events