Expand my Community achievements bar.

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

Workfront API to find Project by Reference Number

Avatar

Level 1

Hi everyone,

 

Is it possible to use the Workfront API to search/add to an existing project using the Ref # and how would that be structured in the URL?

 

Thank you,

Shane

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

You have to modify a project with the UID of the project, but you can for sure search for a project with the reference number, just add referenceNumber={your reference number} to your query string, replacing {your reference number} with the target reference number.

View solution in original post

6 Replies

Avatar

Level 6

Do you mean the External Reference ID?  If so, it would be an API query that would just filter on that.  You can either use the regular Search module or a Custom API module.  The query parameter would be extRefID and the value would just be the value you'd want.  You can also use the regular _Mod modifiers.  (I've found https://github.com/Workfront/workfront-api-constants/blob/master/src/constants.ts to be a really useful resource for seeing those.)

Example query set:

  • extRefID_Mod=cicontains
  • extRefID=SomeSubstringValue

Setting would just be updating the same object to have an extRefID value.

Hope that helps!

Avatar

Correct answer by
Community Advisor

You have to modify a project with the UID of the project, but you can for sure search for a project with the reference number, just add referenceNumber={your reference number} to your query string, replacing {your reference number} with the target reference number.

Avatar

Level 2

Dumb question as I am filling in on this product, but is the UID the ID that is a part of the URL string?

Avatar

Community Advisor

That's correct. In the API, the field is called "ID".

Avatar

Level 2

Thank you, this is all very helpful. Hopefully one of my last questions, but my understanding is that over the course of a specific project the UID can change. Is that correct?

 

We have an integration with another product that pushes assets over. Essentially I have to retrieve that asset when this happens and update the WF Project with that Asset ID #. My worry is that if that UID is constantly changing then I need to go back into the WF API and retreive the latest UID before being able to add in the Asset ID to the Custom Field we have created. 

Avatar

Community Advisor

No, the UID and reference number both are inviolate, for all objects. As long as you are working with the same object, both of those values will always be the same.