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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,459
Community Members
 
Community Events
184
Community Groups

Tempo Timesheet - Java API to set the account field in a worklog

francis
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
Aug 18, 2020

Hi,

 

We are scratching our head here.
We are using Tempo Timesheets, configured with an account worklog attribute.
What is the api to set this account

 

Context

Check the exalate community post 
There is a specific use case where Account information needs to be synced between 2 jira servers.

1 answer

0 votes
Alexander Eck [Tempo]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Aug 19, 2020

Hi Francis,

can I ask you why you are not using the REST API instead?

BR

Hi Alexander,

the REST API would be fine if we would not need to write the Basic Auth credentials into the script. Is there a way to get the credentials of the user executing the groovy script and use those to call the REST API?

Best Regards,
Daniel

Like francis likes this
Alexander Eck [Tempo]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Aug 25, 2020

Hi Daniel,

you should refer to this script. So something like:

def loggedInUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def credentials = ComponentAccessor.userPropertyManager.getPropertySet(loggedInUser).getString(userPropertyKey)

As you run the script as a certain user you need to make sure that this user has the correct permissions in Tempo.

Hope that helps 

BR

Hi Alexander, 

thank you, this looks perfect. I will try this approach.

Like Alexander Eck [Tempo] likes this

Hi Alexander,

as far as I can see we would still need to write the plaintext Passwort into the user-defined property in Jira in order to use the REST API with Basic Auth. Is this correct?

Users would not be able to change their Passwords themselfs (without breaking the Authentication) and the plaintext Password would still be visible to at least the admins as well. Is there no other way to authenticate?

Would App Links and OAuth be an Option? https://scriptrunner.adaptavist.com/latest/bitbucket/interacting-with-other-apps-via-applinks.html

best regards

Alexander Eck [Tempo]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Aug 31, 2020

Daniel,

that is beyond my knowledge. But as far as I know you don´t need to save the password as plain text in a User property. Maybe some more advances Groovy experts out there that can possibly answer that question. Still best way is to try it out.

BR

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events