API call: Attach / assign existing custom field (parameter) to existing custom form (category) | Community
Skip to main content
lgaertner
Level 9
March 17, 2023
Solved

API call: Attach / assign existing custom field (parameter) to existing custom form (category)

  • March 17, 2023
  • 1 reply
  • 1080 views

Hello,

 

I want to add an existing custom field to an existing custom form using the API.

 

I know how to get all custom fields assigned to a specific form using

https://<domainname>.my.workfront.com/attask/api/v15.0/ctgy/<customFormId>?fields=categoryParameters:parameter

but I don't know how to add another one to the categoryParameters.

 

Thanks in advance.

Regards

Lars

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by lgaertner

Thank to the help of the customer support, I can now share how to do this:

 

You first have to run a GET request to get all currently assigned fields / parameters:

 

https://<domain>.my.workfront.com/attask/api/v15.0/ctgy/<categoryID>?fields=categoryParameters:*

 

In the next step, you have to run a PUT call containing the previous parameters and the new one(s):

 

PUT HTTP REQUEST URL: https://<domain>.my.workfront.com/attask/api/v15.0/ctgy/<categoryID> JSON BODY: { "categoryParameters": [ { "objCode": "CTGYPA", "categoryID": "<categoryID>", "customerID": "<customerID>", "displayOrder": 1, "hideFormulaFromDescription": false, "isInvalidExpression": false, "isRequired": false, "parameterGroupID": "<parameterGroupID>", "parameterID": "<parameterID>", "rowShared": false, "securityLevel": "LE", "viewSecurityLevel": "V" }, { "objCode": "CTGYPA", "categoryID": "<categoryID>", "customerID": "<customerID>", "displayOrder": 2, "hideFormulaFromDescription": false, "isInvalidExpression": false, "isRequired": false, "parameterGroupID": "<parameterGroupID>", "parameterID": "<parameterID>", "rowShared": false, "securityLevel": "LE", "viewSecurityLevel": "V" }, { "objCode": "CTGYPA", "categoryID": "<categoryID>", "customerID": "<customerID>", "displayOrder": 3, "hideFormulaFromDescription": false, "isInvalidExpression": false, "isRequired": false, "parameterGroupID": "<parameterGroupID>", "parameterID": "<parameterID>", "rowShared": false, "securityLevel": "LE", "viewSecurityLevel": "V" } ] }

1 reply

lgaertner
lgaertnerAuthorAccepted solution
Level 9
March 20, 2023

Thank to the help of the customer support, I can now share how to do this:

 

You first have to run a GET request to get all currently assigned fields / parameters:

 

https://<domain>.my.workfront.com/attask/api/v15.0/ctgy/<categoryID>?fields=categoryParameters:*

 

In the next step, you have to run a PUT call containing the previous parameters and the new one(s):

 

PUT HTTP REQUEST URL: https://<domain>.my.workfront.com/attask/api/v15.0/ctgy/<categoryID> JSON BODY: { "categoryParameters": [ { "objCode": "CTGYPA", "categoryID": "<categoryID>", "customerID": "<customerID>", "displayOrder": 1, "hideFormulaFromDescription": false, "isInvalidExpression": false, "isRequired": false, "parameterGroupID": "<parameterGroupID>", "parameterID": "<parameterID>", "rowShared": false, "securityLevel": "LE", "viewSecurityLevel": "V" }, { "objCode": "CTGYPA", "categoryID": "<categoryID>", "customerID": "<customerID>", "displayOrder": 2, "hideFormulaFromDescription": false, "isInvalidExpression": false, "isRequired": false, "parameterGroupID": "<parameterGroupID>", "parameterID": "<parameterID>", "rowShared": false, "securityLevel": "LE", "viewSecurityLevel": "V" }, { "objCode": "CTGYPA", "categoryID": "<categoryID>", "customerID": "<customerID>", "displayOrder": 3, "hideFormulaFromDescription": false, "isInvalidExpression": false, "isRequired": false, "parameterGroupID": "<parameterGroupID>", "parameterID": "<parameterID>", "rowShared": false, "securityLevel": "LE", "viewSecurityLevel": "V" } ] }