GET tickets within milestone

133 views
Skip to first unread message

mark.w...@site1001.com

unread,
Feb 24, 2017, 8:21:18 PM2/24/17
to Assembla API Development
While trying to use API to return all tickets in a milestone with a certain Status, I am finding it doesn't honor some of the parameter.
Namely:
ticket_status,
per_page

API ref:

Example:

var client = new RestClient("https://api.assembla.com/v1/spaces/<SPACEID>/tickets/milestone/<MILESTONE_ID>");
var request = new RestRequest(Method.GET);
request.AddHeader("postman-token", "914cf678-0cab-b421-74ed-9d1f9100423c");
request.AddHeader("cache-control", "no-cache");
request.AddHeader("ticket_status", "Development Complete");
request.AddHeader("per_page", "100");
request.AddHeader("x-api-secret", "---------------------");
request.AddHeader("x-api-key", "-----------------");
IRestResponse response = client.Execute(request);
I don't get 100 records or tickets back, I get 10 or fewer. The json listing of tickets has all states, active, closed, on hold.
Basically my goal is tickets in "Development Complete" which is a type of "closed" ticket, needs to be state changed to "Deployed" once a deployment is completed by our CI/CD system.

The milestone has typically 60 items/tickets. if I can't get the list of wanted status, I'd even take all tickets in the milestone, but the "per_page" parameter isn't seeming to work either..

I must be using the 2 parameters wrong, or maybe it is some configuration issue on our Assembla WRT tickets?
Any one get this to work, search for tickets of a milestone of status closed?

 

Stanislav Kolotinskiy

unread,
Mar 1, 2017, 2:10:54 AM3/1/17
to mark.w...@site1001.com, Assembla API Development
Hi Mark,

I just checked it out and it worked absolutely fine for me. I was able to filter tickets by status (active, closed, all), I was also able to get paginated results with page and per_page params. Default page size is 10 records not 100, while maximum page size is 100 records, so if you pass more than that, it’ll still return 10 records. Can you please write me an email with some more details, like a curl request or an example output from the code snippet that you posted?

Regards,
Stanislav

--
You received this message because you are subscribed to the Google Groups "Assembla API Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to assembla-api-d...@googlegroups.com.
To post to this group, send email to assembla...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mark.w...@site1001.com

unread,
Apr 12, 2017, 1:29:31 PM4/12/17
to Assembla API Development, mark.w...@site1001.com
Hi Stanislav,
Been a while, got pulled away from this task.
My goal is to update tickets set to "Development Complete" to a "Deployed to <ENV>" where ENV is existing state type/label,  post deployment.

Here is an example.
Currently have 8 "New" status tickets in a mile stone. I get result showing 1 new, and some "On Hold",an "Refinement" which may be based or in "state" NEW, but I want the tickets in actual "New" to show. OR at least all ticket states that are of  "New" type, to list.  


Context for a current milestone.

Using "site1001 v3.6.0” as the milestone of interest.  as shown here:

Suggest from API ref, 
    Example GET URL: 

space_id : SE_Dunn
milestone_id : 10302703-site1001-v3-6-0

Fashioned URL:
With header params:
per_page : 100
ticket_status : New

I am using Postman for my testing and formation of the URL and calls, but here is an export in C# . 
var request = new RestRequest(Method.GET);
request.AddHeader("postman-token", "4a63abaf-f846-5411-63f3-5444399dfc2e");
request.AddHeader("cache-control", "no-cache");
request.AddHeader("ticket_status", "New");
request.AddHeader("per_page", "100");
request.AddHeader("x-api-secret", "<MySecretHash>");
request.AddHeader("x-api-key", "<MyAPIKey>");
IRestResponse response = client.Execute(request);
OR in a CURL 
curl -X GET \
  -H 'cache-control: no-cache' \
  -H 'per_page: 100' \
  -H 'postman-token: 43264aa1-1662-93fb-ca11-da5fe908d661' \
  -H 'ticket_status: New' \
  -H 'x-api-key: <myAPIKEY>' \
  -H 'x-api-secret: <MySecretHash>' 


I get a result of 10, of various states...  Truncated Json ....
[
  {
    "id": 126587033,
    "number": 1998,
...,
   ...  },
  {
    "id": 154737793,
    "number": 2123,
    "summary": "Reports Scope",
...
    "status": "Active",
   ...  },
  {
    "id": 159421773,
    "number": 2149,
    "summary": "Update Help Documentation",
    "...
    "status": "New",
...  },
  {
    "id": 166474323,
    "number": 2211,
    "summary": "Allow bulk assignment of assets to asset groups",
   ...,
    "status": "Refinement",
    ...  },
  {
    "id": 168572603,
    "number": 2309,
    "summary": "Add Fail Button to Task",
  ...,
    "status": "Refinement",
    ....},
  {
    "id": 168573013,
    "number": 2311,
    "summary": "Make Activate Easier",
....
     "status": "On Hold",
    ...  },
  {
    "id": 169062873,
    "number": 2351,
    "summary": "Mobile Updates - add these things to the current App",
    ...,
    "status": "On Hold",
   ...  },
  {
    "id": 169121223,
    "number": 2359,
    "summary": "History Button modal window is not always showing the correct number of items (bottom right)",
    ...,
    "status": "On Hold",
    ...  },
  {
    "id": 169614653,
    "number": 2396,
    "summary": "Move buttons to the top of every page",
    ...,
    "status": "Refinement",
    ...
  },
  {
    "id": 169658353,
    "number": 2401,
    "summary": "Colors for Gauges",
    ...,
    "status": "Refinement",
    ..  }
]

I expect the "New" only state set tickets, OR . all  tickets of "type New" to return, in that case I would get tickets that are NEW, Refinement, On Hold, etc... ticket state types of "New", in our current milestone we don't have more than 100 tickets, so I figured I'd get all tickets of type "New."

 I didn't setup our Assembla, but when there are spaces in the value of a parameter, do I need to escape it?  We have a state like these:





Currently I have this view of tickets in the milestone.




Thanks!

Stanislav Kolotinskiy

unread,
Apr 19, 2017, 11:11:04 AM4/19/17
to mark.w...@site1001.com, Assembla API Development
Hi Mark,

in order to get some specific tickets filtered by status AND milestone, you might want to create a report with these filters and then just use it within the API. Please let me know if that helps.

Regards,
Stanislav

Alain Orset

unread,
May 2, 2017, 9:06:34 AM5/2/17
to Assembla API Development, mark.w...@site1001.com
Hi Stanislav,

I have a similar problem than Mark and try to follow you advice.
I have managed to get tickets using the report in the url as below

.../tickets?report=1&per_page=100&page=1

However, I have no idea how to create a new report.
I had a look at the tickets section in the assembla site, and could not find a way to list all existing report, or create a new one.
Looking at the API, it is not possible either the get a list of existing report.

How can I create a report?

Best regards,

Alain
To unsubscribe from this group and stop receiving emails from it, send an email to assembla-api-dev+unsub...@googlegroups.com.

wojc...@assembla.com

unread,
May 9, 2017, 6:30:42 AM5/9/17
to Assembla API Development, mark.w...@site1001.com
Hi Alain, 

You can create new report using filters functionality on cardwall (https://blog.assembla.com/real-time-cardwall-realtimeproductivity).
Then you can get list of custom reports/filters using http://api-docs.assembla.cc/content/ref/tickets_custom_reports.html request. 
After all get filtered tickets using http://api-docs.assembla.cc/content/ref/tickets_index.html.

Let me know if you have any other questions,

Best,
Wojciech

Mark Walters

unread,
Jun 5, 2017, 12:48:03 PM6/5/17
to wojc...@assembla.com, Assembla API Development
Thanks Wojciech!  Made a little progress. I am still not getting the right set of return on the filter/report angle too.  Even though I created a filter for only one status, I am getting status that are not in my report...

curl -X GET \
  https://api.assembla.com/v1/spaces/SE_Dunn/tickets.json \
  -H 'cache-control: no-cache' \
  -H 'per_page: 100' \
  -H 'postman-token: 3d496e36-104e-f7f6-73f6-3209e10cd1e3' \
  -H 'report: 3261743' \
  -H 'ticket_status: New' \
  -H 'x-api-key: .....' \
  -H 'x-api-secret: ......'

Number 1 below shows, locating the report I created to only show 1 status. Development complete
Number 2, shows how statuses are not being maintained as define in the report. 
Inline image 1 

Report/filter spec: showing "Development Complete"
Inline image 2

I shouldn't get a result with "Deployed to PROD"

---thanks Mark

To unsubscribe from this group and stop receiving emails from it, send an email to assembla-api-dev+unsubscribe...@googlegroups.com.

To post to this group, send email to assembla...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.




--
Mark A. Walters
Release Management Engineer
Site 1001 Inc. | Building Vision

1001 Locust Street, 3rd Floor
Kansas City, MO 64106
e: mark.w...@site1001.com
t: 208.660.1666

   
Reply all
Reply to author
Forward
0 new messages