Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Time in Status REST API Authentication and Request

Arjay Villavicencio January 25, 2022

We are looking for a solution to fetch the time between the change of status via Rest API. We are currently using Time in Status app but I couldn't make the request via  REST API work.

I'm following the documentation here: https://dev.obss.com.tr/confluence/display/MD/TiS+Cloud+-+REST+Reporting

What we are trying to achieve:
- Get the time between status change

  - Example: New = 0d 0h 0m 5s -> Assigned 0d 05 29m 21

  - Technically, a json version of the image below. 

On the other hand, I need guidance on how to use the tisjwt token, I have generated a token on Time is Status API Setting but I am not sure where to place this parameter.

On Time in Status documentation below is the request example.

<service_url>/rest/issue?issueKey=<issueKey>

But when you run this it will return an error that tisjwt token is required. I also tried <service_url>/rest/issue?issueKey=<issueKey>&tisjwt=<token> but it is still not working.

aaa1.jpg

1 answer

0 votes
Hana Kučerová
Community Champion
January 25, 2022

Hi @Arjay Villavicencio ,

about the token parameter - see the section Authorization in the provided documentation. 

There are two ways how to do it - either add it as an authorization header or as a query parameter.

I can see you've tried to add is as a query parameter, which seems ok to me (but it is recommended to use the request header)

The problem could be in the endpoint /rest/issue. According to the documentation at least two parameters are required - issueKey and also columnsBy. The other mandatory parameters depends on the type of report.

Arjay Villavicencio January 25, 2022

Can you provide me with an example of how to use it on a header? 

Hana Kučerová
Community Champion
January 25, 2022

It is a standard request header parameter:

  • key: Authorization
  • value: TISJWT <your_token>

I would recommend you to use product Postman or similar to help you debug the request.

Arjay Villavicencio January 25, 2022

curl -H "Authorization: TISJWT <token>" https://tis.obss.io/rest/issue?issueKey=<issue_key>&columnsBy=statusDuration

 

I have tried this but I got this error.

{"status":400,"message":"Invalid report parameters","messages":["ERROR: columnsBy parameter is required. Possible values are assigneeduration, statusduration, durationbetweenstatuses, groupduration, statusdurationbygroup, groupdurationbystatus, transitioncount, statuscount, firsttransitionfromstatusdate, firsttransitiontostatusdate, lasttransitionfromstatusdate, lasttransitiontostatusdate, assigneedurationbystatus, statusdurationbyassignee, anyfieldduration"],"pluginVersion":"1.50.0.585","time":"2022-01-25 12:30:45 +0000"}

Hana Kučerová
Community Champion
January 26, 2022

So, error 400 means, that authorization is ok, but you are sending invalid parameters for the report. But it is weird, because according to the error message - columnsBy parameter is missing, but you are sending it.

Have you tried to use "statusduration" value instead of "statusDuration"?

Arjay Villavicencio January 26, 2022

I have tried both but no luck. Kindly check the below image.

aaa1.jpg

Hana Kučerová
Community Champion
February 19, 2022

Hi @Arjay Villavicencio ,

I'm sorry for the late answer. Were you able to make this work?

I've tested it today and it worked for me. I had to add parameter calendar.

https://tis.obss.io/rest/issue?issueKey=<issue_key>&columnsBy=statusDuration&calendar=normalHours

Your error message is really strange (like the parameter statusDuration is not recognized). Maybe you can try to ask the vendor, what could this be, I'm sorry I really don't know what's wrong. It looks right.

Arjay Villavicencio February 21, 2022

Unfortunately I am still having the same error even with calendar=normalHours. Is there any way I can reach you via call? So that we can clearly discuss my issue.

Suggest an answer

Log in or Sign up to answer