Hello,
My name is Ian Balas and I'm a system admin for a brokerage company in Long Island, NY.
Our marketing department uses Jira Software (Cloud edition) to keep track of tasks and projects.
My director wants a report of all work logs from each user in our instance from all issues (Jira's version of tickets) regardless of who's assigned to the issue.
JQL (Jira Query Language) filters usually help with most types of reporting we need, but not for this case. When trying filters like:
project = MAR AND worklogAuthor in membersOf("Aress (Marketing)")
to attempt to pull the work logs entered all time by users in this group, it'll give us the time spent on those issues, but unfortunately also accounts for the hours from work logs entered by other users on those issues. In simpler terms, that JQL filter will pull the issue in which the user logged work on, but the value in "Time Spent" will be a lot larger due to other users logging in work on that issue.
We either have to buy an add-on called Jira Timesheets in which users keep track of all their individual work logs (this would cost us well over $70/month cross-licenses for just one person who would use it...so we really want to avoid this route), or I would have to create something through Jira Cloud's REST API that pulls individual user's work logs across all users. I'm working on the latter, of course.
I figured work on this using Postman API Dev environment. The problem is that I can't seem to pull anything from our Jira instance... and I think it's because I haven't been able to successfully establish any Authorization from Postman <-> Jira.
Any help or guidance would be appreciated.
And if anyone has any better ideas on how to create a field/add-on that'll give us work logs from individual users, do tell me.
Hi @Ian Balas
You haven't really said what you've tried in Postman and what issue / error you're getting, but for now I'm assuming it's an authorisation problem. See this for details on authorisation - you need to use your Jira e-mail address and an API token created with that same e-mail address.
If this isn't the issue, possibly give more details on your authorisation, the actual API call used and what error you get
Hi @Warren,
Yes, it's an authorization problem. Sorry I wasn't clear enough before.
So I tried following the documentation for Generating API Tokens. I went ahead and generated an API token to connect Postman to our Jira Cloud instance. Afterward, I entered this cURL command:
curl -v https://nationalbusinesscapital.atlassian.net --user ibalas@national.biz:api_token
via Command Prompt and it seems to have authorized here. (See first screenshot below).
But then I went back into Postman and tried pulling one of the issues in my Jira instance and I was met with a 401 Unauthorized error (See 2nd screenshot below).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ian Balas
So in Postman, under Authorization, there's a Type dropdown, you should have selected Basic Auth. What are you using?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@[deleted] I just figured it out.
I was using Basic Auth but was running the pull requests with my login credentials instead of the API token. I replaced my password with the API token and was successfully able to pull the work logs from one of the issues in my JIRA instance.
So in regard to connecting to my Jira instance with Postman, I think that'll do it! Now the next part for me is trying to pull the individual work logs from our JIRA instance for members of a user group from all time, and then converting that result from json to excel/csv so that our marketing director will know how much work each individual user put in for a set of issues.
That's a whole other task for another thread, but if you have any input on that I'm open to it.
Otherwise, thank you for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ian Balas
Pleasure, I'm glad you've got it working.
I don't know if you are able to code, or have access to someone who can, because that will be your easiest route to progress with the worklogs. I use C# and can help with some code to get you started, I know many people use java as well, I started with VBA within an Excel workbook.
The reason I suggest coding it is because you're potentially going to get back a large amount of data that will need to be sifted through to find the info you want, then aggregated - you're also probably going to be doing this for your director on an ongoing basis, not as a one-off.
Let me know if you'd like some C# sample code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Initially, I just thought of running a GET request for individual work logs and then just converting from JSON to CSV/Excel and getting the work logs like that whenever my director requests them.
But you think this should be coded to make it easier? I'm open to it... me personally, I have experience in JavaScript more than any other obj. oriented language, along with some past experience with Java and C# but otherwise that's my palette right there. There is someone in my department who knows Java pretty well, though.
But regardless, if you could send me some sample code to work off of that'd be great.
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ian Balas
If you look at my answer here there's some sample C# code - it is from the "good old days" before GDPR changes etc. so you'll need to use your Jira e-mail address for the variable m_Username and the API token generated using that e-mail address for the variable m_Password. See this doc about API tokens.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.