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

Tempo API: how to get all worklogs for all users and projects

BoYaroslav March 6, 2016

Hello

I need to get all worklogs for period for all users and projects via REST API (for PivotGrid and some charts)

If I am setting up project key, I'm getting data for all users:
/rest/tempo-timesheets/3/worklogs?dateFrom=2016-02-07&dateTo=2016-02-21&projectKey=AIPUDJ

But if I'm using url without projectKey (/rest/tempo-timesheets/3/worklogs?dateFrom=2016-02-07&dateTo=2016-02-21), I'm getting data for all projects, but only for user, whos credentials are in use. This user is granted as much permissions as possible - he is admin, he is granted Permission to View Project worklogs and added as default user into all projects. But still can't retriev info about other users. Is it possible to retriev all users for all projects?

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Answer accepted
Susanne Götz [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.
March 6, 2016

Hi Yaroslav, 

when you need to get all the worklogs for a period, for all users and projects, we recommend using the Tempo Servlet (xml export). This will return all worklogs and you can set additional parameters or filters for the export. 

Please take a look at https://tempoplugin.jira.com/wiki/display/TEMPO0716/Tempo+Servlet+Manual for more information.

Regards,

Susanne

1 vote
Susanne Götz [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.
March 7, 2016

The API's are a work in progress and with new features, new functionality gets added. As all the Tempo API´s are private and subject to change, it might cause problems when you use them to integrate with other systems. 

The Servlet is currently the only public API, so it needs no maintenance when you upgrade Tempo to a new version.

Dmytro Litvinov March 9, 2017

Hello. Is API of Tempo timesheet is working now? From yesterday I get 404 page always in my query url. Could you help me, please?

Deleted user July 18, 2018

Hello Dmytro, have you found any alternate. I am also facing the same problem.

I have generated the token, but I don't know where I should include that in the api. Please help

1 vote
BoYaroslav March 7, 2016

Thanks a lot for this tip. Tempo Servlet contains everything what I need. Do you have in plans to add same functionality ino rest API? (JSON a bit simple in use in javascript)

0 votes
Rich Scire January 26, 2017

Sadly, the servlet is not currently working for me so I need an alternative way of doing exactly what this user requested. How can I get the time for all users for a period using the REST API? I tried adding the jira-users group to a team and then specifying the team id but all I got was an empty set.

Steve Arena March 13, 2017

  GET   https://YOURDOMAIN.atlassian.net/rest/tempo-timesheets/3/timesheet-approval is not documented at http://tempo.io/doc/timesheets/api/rest/latest/  (

 

but to get a list of tempo usernames in C# 

 

string json = RestClient.MakeWebClientRequest("https://YOURDOMAIN.atlassian.net/rest/tempo-timesheets/3/timesheet-approval ", encodedCredentials);


Approvals _approvals = new Approvals();
_approvals = Newtonsoft.Json.JsonConvert.DeserializeObject<Approvals>(json);


List<string> names = new List<string>();
foreach (Approval A in _approvals .approvals) // get the list of usernames
{
names.Add(A.user.name);
}
return names;
}

public class Period
    {
        public string periodView { get; set; }
        public string periodId { get; set; }
        public string dateFrom { get; set; }
        public string dateTo { get; set; }
    }

    public class User
    {
        public string self { get; set; }
        public string name { get; set; }
        public string displayName { get; set; }
        public string avatar { get; set; }
    }

    public class Worklogs
    {
        public string href { get; set; }
    }

    public class Approval
    {
        public User user { get; set; }
        public string status { get; set; }
        public int workedSeconds { get; set; }
        public int submittedSeconds { get; set; }
        public int requiredSeconds { get; set; }
        public int requiredSecondsRelativeToday { get; set; }
        public  period { get; set; }
        public string smartDateString { get; set; }
        public Worklogs worklogs { get; set; }
    }

    public class Approvals
    {
        public Period period { get; set; }
        public IList<Approval> approvals { get; set; }
    }

 

 

 

 

 

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events