Expand my Community achievements bar.

Latest Community Ideas Review is Out: Discover What’s New and What to Expect!

Queries on Workfront API to get project data.

Avatar

Level 1

Query 1:

By default, the below API is returning only a few fields/attributes of the specific project:

https://{mydomain}.my.workfront.com/attask/api/v17.0/project/***********?sessionID=*************

 

Is there an option to get all the fields/attributes of the given project?

 

Query 2:

How to get all comments/stausUpdates of the project?

By default is it returning only one/first comment with the below API:

 

https://{mydomain}.my.workfront.com/attask/api/v17.0/project/**************?sessionID=*************&...

 

 

 

10 Replies

Avatar

Level 10

Hello,

 

First of all, you need to be careful posting such links, as you only anonymized the link text, but not the link itself.
So it still contains your session key.

 

Query 1:

You have to add fields=* to your query like this:
https://urldefense.com/v3/__https:/novartisgbs.my.workfront.com/attask/api/v17.0/project/<projectID>... 

I you have custom fields you should also add parameterValues.

 

https://urldefense.com/v3/__https:/novartisgbs.my.workfront.com/attask/api/v17.0/project/<projectID>...

 

 

Query 2: 

 

To get all comments / statusUpdates doing  a search should help:

 

https://urldefense.com/v3/__https:/novartisgbs.my.workfront.com/attask/api/v17.0/project/search?ID=<... 

 

Regards

Lars

Avatar

Level 1

Hi 

 

Thanks for the quick reply and tip regarding the token, I've invalidated the token and also edited the post to remove any references.

 

Coming to my queries, the first one is resolved. I'm able to get all the fields using * 

 

But the second one regarding the comments, it's still not clear to me.

The link you've given just taking back me to my post.

Using "fields=statusUpdate" returns only the first comment but not all.

 

Can give me a sample to get all the fields?

 

Avatar

Level 10

Hi,

 

the second should look like this:

https:/novartisgbs.my.workfront.com/attask/api/v17.0/proj/search?id=<projectID>&fields=statusUpdate,updates&sessionID=<sessionID>

 

Regards

Lars

Avatar

Level 1

Hi,

 

Still, no luck, tried with "fields:statusUpdate,updates", but still getting only one comment, the only change I observed with updates in the field is it is returning "System Activity".

 

Let me explain:

For one of the projects, there is a comment and there are two replies to that comment, please see below:

SivatejaReddy_NVS_0-1699276452756.png

However the API is responding with only the first comment, but not the replies.

Avatar

Level 10

The replies are available through a collection, so you should use the following endpoint:

 

&fields=statusUpdate,updates:replies:*

 

Regards

Lars

Avatar

Level 1

Thanks, it works for me.

I have a follow-up question. 

How to get all the comments, it returns only the first comment and its replies.

We need to get all the comments and their replies.

Avatar

Level 1

Hi

 

I've posted my follow-up query, could you please check and comment?

Avatar

Level 10

Hi,

 

I just tested it again and I do get all comments with the call as described.

Could you please post your complete API call to double check?

 

Regards

Lars

Avatar

Level 1

Hi,

 

Below is the API call I tried:

 

https://{mydomain}.my.workfront.com/attask/api/v17.0/project/{projectID}?fields=statusUpdate,updates:replies:*&sessionID={sessionID}

 

Please note that the project ID I'm using has 100+ user comments, but this API is returning only the first two.

Avatar

Level 10

Hi,

 

Ok, that is really strange.

 

I checked different things but always do get all comments, although I do not have an example with more than 5 comments.

 

My call was 

https://{mydomain}.my.workfront.com/attask/api/v17.0/proj/search?id={projectID}&fields=statusUpdate,updates:replies:*

 

but it leads to the same result as yours.

 

I also switched between API versions, but also no difference.

 

As you have 100+ comments, perhaps the output is too large as described here:

https://experienceleague.adobe.com/docs/workfront/using/adobe-workfront-api/api-general-information/...

 

But I don't have any clue, how the API behaves in such a case.

 

Perhaps you could try to work with "Using Paginated Responses" (also described in the API basics), but I did not test that.

 

I will think about another solution and get back to you if I have any idea.

 

Regards

Lars