Documentation

task.item.userfield.add

This method creates new property.

System limitation for field name - 20 symbols. Prefix UF_TASK_ is always added to user field name. It means that the actual length of the name - 12 symbols.

Method parameters

ParameterDescription
authAuthorization token.
PARAMSArray with parameters of array type property ("parameter": 'value' [, ...]), containing the following parameters:
  • USER_TYPE_ID - user field data type. Accessible values are as follows:
    • string (String);
    • double (Number);
    • date (Date);
    • boolean (Yes/No);
  • FIELD_NAME - field code;
  • XML_ID - external code;
  • EDIT_FORM_LABEL - edit from label (specified in English ('en') language;
  • LABEL - field title.

Call examples.

$appParams = array(
          'auth' => 'q21g8vhcqmxdrbhqlbd2wh6ev1debppa',
          'PARAMS' => array(
                   'USER_TYPE_ID' => 'string',
                   'FIELD_NAME' => 'NEW_TASKS_FIELD',
                   'XML_ID' => 'MY_TASK_FIELD',
                   'EDIT_FORM_LABEL' => array(
                       'en' => 'New task field',
                   ),
                   'LABEL' => 'New task field'
           ),
);

$request = 'http://your-com/rest/task.item.userfield.add.xml?'.http_build_query($appParams);'

BX24.callMethod(
	'task.item.userfield.add',
	{ 'q21g8vhcqmxdrbhqlbd2wh6ev1debppa', ['USER_TYPE_ID' : 'string', 'FIELD_NAME' : 'NEW_TASKS_FIELD', 'XML_ID' : 'MY_TASK_FIELD', 
    'EDIT_FORM_LABEL' : ['en' : 'New task field',], 'LABEL' : 'New task field']},

	function(result)
	{
		console.info(result.data());
		console.log(result);
	}
);

© «Bitrix24», 2001-2024