1

There is a existing request:

$requestUrl = "/users/".$userId."/tasks";

But it looks like it doesn't work for Subscriber, its empty. If I do a Assigned for this User, well it's filled but I require it for Subscriber.

Sadly I didn't find something in the documentation.

array(3) {
  ["tasks"]=>
  array(0) {
  }
  ["subtasks"]=>
  array(0) {
  }
  ["related"]=>
  array(0) {
  }
}

Do anyone know, if there is a request where i can find all tasks, which are Assigned, Created or Subscribed by a certain user id?

Or is there a chance I found a bug?

Sjon
  • 4,989
  • 6
  • 28
  • 46
Silver
  • 23
  • 2
  • Welcome to stack overflow! Please take a look at the advices to create a good question at http://stackoverflow.com/help/how-to-ask – ssice Apr 21 '16 at 13:53
  • Added more info and assignments report example. – Ilija Apr 22 '16 at 08:50

2 Answers2

0

Resource /user/:user_id/tasks returns user's assignments (tasks and subtasks that user is assigned to). That's how it was designed to work and that's how it works, so that's not a bug.

Active Collab 5 does not feature an API resource that can return you all of the user's subscriptions.

To get a list of tasks that user created, you can run an assignment filter report, by sending this list of query arguments:

  • type: AssignmentFilter (required)
  • created_by_filter: selected_USERID,USERID,USERID (list of user ID-s)
  • include_subtasks: 0 or 1 (include subtasks, or not)
  • include_all_projects: 0 or 1 (when report is ran by an Owneer, should we look through all projects, or only projects that this Owner is assigned to).

Example:

GET https://myac.com/api/v1/reports/run?created_by_filter=selected_USERID,USERID,USERID&include_subtasks=0&type=AssignmentFilter&include_all_projects=1

Resource reports/run is available to users with Owner and Member+ role (Member with permissions to start new projects and invite people). It is not available to Members without that permission or people with Client role.

PS: I work for Active Collab.

Ilija
  • 4,105
  • 4
  • 32
  • 46
  • Thanks, i will check it out. Wouldnt have noticed.. but true you have most git commits. – Silver Apr 22 '16 at 14:37
  • Okay, i doesnt feel like i can use this. (just a feeling). At first i thought there is something easy, some Request i just oversaw, this AssigmentFilter goes in the Right Direction. But.. my Situation is like this: Multiple Projects, 1 User Id and Company Id we know, the Requirement to get all Tasks where a User is Subscriber. And if possible... without a Owner which is logged in, it should work with "Client" or "Client+" (this is just nice to have). I tried the Reports in AC but they dont do what i want. Well if its not possible, then its not possible, im okay with that. no brute force sol. – Silver Apr 22 '16 at 15:27
  • There's currently no API resource that will list all of user's subscriptions. As shown above, you can easily find all tasks that user is assigned to, or all tasks that user created (proper permissions with access to reports will be required). Reports API can be used by Owner and Member+ users. It is not available to regular members and clients. – Ilija Apr 22 '16 at 20:16
  • I've updated the answer with info about `/reports/run` permissions. – Ilija Apr 22 '16 at 20:20
  • @Ilija: I am trying to returns user's assignments with .../api.php?path_info=user/13/tasks&auth_api_token=myToken&format=json (Active Collab API version: 2.3.1), but for any reason the response will be 'Page "user/13/tasks" not found.' (I am just using the Chrome Browser for displaying the response). Any idea what I am doing wrong? – HH. May 23 '16 at 13:02
0

since there is no easy way to get all Tasks where a User X is Subscriber. I think i will use a Workaround Solution, like creating a Tasklist or Using a new Tag, since the main goal was to Create on AC like "Answer" Tickets, so that the Customers/Ticket Creators on our System get a proper Answer (i know there are Comments, but it wont work for us). And then Request the Tasklist or Filter for Tag and then use the Assigne ID for it.. or the more Brute Force Method to Call for every Task the Get Method and Look for Subscribers.

GET /projects/1/tasks/2

Have a nice Day.

Silver
  • 23
  • 2