Getting Billable Field in Jira Rest API

Rupa Mistry November 19, 2017

Hi Team

I have been using api for getting all the issues of any project. Although I am getting all the fields from the issue, one that is particulary important missing is Billable field. Can you guide me in how to retreive data for this field on issue level.

2 answers

0 votes
Alexey Matveev
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.
November 20, 2017

Error 504 means that the result was not returned in the specified time. I guess you need to enter some limits. For example limit it by date

/rest/tempo-timesheets/3/worklogs?dateFrom=2017-11-19

0 votes
Alexey Matveev
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.
November 19, 2017

Hello,

What REST API do you use to get all the issues of any project?

Rupa Mistry November 20, 2017

Hi,  Alexey

 

I am using following url for getting issue data of particular project.

"rest/api/2/search?jql=project=TWOXL&startAt=0&maxResults=100"

 

But I am not able to retreive billable field from above url result

Alexey Matveev
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.
November 20, 2017

By default only navigable fields are shown. You should change your rest to

"rest/api/2/search?jql=project=TWOXL&startAt=0&maxResults=100&fields=*all"

You need to pass fields=*all parameter

Rupa Mistry November 20, 2017

Hi Alexey,

I am still not able to get the billable field/key inside the response. Can you elaborate on this

Alexey Matveev
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.
November 20, 2017

The Billable field is a custom field, right? What is the type of the field? Kindly by this REST call try to select an issue which has the field filled.

Rupa Mistry November 20, 2017

I don't think this is a custom field, its provided as default with the API, but in case if it is a custom field, how should I approach it. Also I have gone through plenty of issues, but haven't found any filed that matches billable/non-billable

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 20, 2017

It is definitely a custom field.  Most of the Jira systems I work with do not have it, and it is not there when you install a new one.

Could you maybe look at an issue that has a value for it in the UI and then make a REST call to fetch the same issue so we can see that it is there and how it comes out?

Rupa Mistry November 20, 2017

I checked the list of custom fields by going to JIRA Administration>Issues>Fields>Custom Fields. It's not there on that list so it's not a custom field. 

Btw, the name of that field is 'Non-Billable'. It's a checkbox that appears when someone enters a worklog.

Alexey Matveev
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.
November 20, 2017

I guess it is a Tempo plugin field and it relates to worklogs, not to issues. You would need to use Tempo Rest Api to get the information. Try to use

http://{JIRA_BASE_URL}/rest/tempo-timesheets/3/worklogs/

You can read more about REST API here

https://tempo.io/doc/timesheets/api/rest/latest/

Rupa Mistry November 20, 2017

I tried replacing {JIRA_BASE_URL} with account domain, but I am not getting any response. I am getting 504 as response code.

Rupa Mistry November 20, 2017

Sorry my bad, I wasn't using proper url to fetch the data, but still I am not getting the non-billable field in the response , I am using the following url for getting data - "rest/tempo-timesheets/3/worklogs?projectKey=TWOXL"

Rupa Mistry November 20, 2017

Hi Alexey,

I found the field. Thanks for the help.

Suggest an answer

Log in or Sign up to answer