The following topic describes objects used in CSV Import scripts.
To create a task, put the following data into the resulting Map:
Key |
Value Type |
Default Value |
Required |
Description |
OBJECT_TYPE |
String |
CSVImport.TASK_TYPE |
No |
Object type ID |
TASK_NAME |
String |
"Not specified" |
No |
Task name |
TASK_SHORTNAME |
String |
null |
No |
Task alias |
TASK_DESCRIPTION |
String |
"" |
No |
Task description |
TASK_BUDGET |
String or Double |
null |
No |
Task budgeted time |
TASK_DEADLINE |
Calendar |
null |
No |
Task deadline |
TASK_PRIORITY_ID |
String |
Default priority |
No |
Task priority ID |
TASK_HANDLER_USER_ID |
String/Map |
null |
No |
Task handler (user) ID/Map |
TASK_HANDLER_GROUP_ID |
String |
null |
No |
Task handler (user status) ID |
TASK_CATEGORY_ID |
String |
Must be defined |
Yes |
Task category ID |
TASK_SUBMITTER_ID |
String/Map |
Logged user |
No |
Task submitter ID/Map |
TASK_SUBMIT_DATE |
Calendar |
Current date |
No |
Task submit date |
TASK_UPDATE_DATE |
Calendar |
Current date |
No |
Task update date |
TASK_CLOSE_DATE |
Calendar |
null |
No |
Task close date |
TASK_RESOLUTION_ID |
String |
null |
No |
Task resolution ID |
TASK_STATUS_ID |
String |
Start state |
No |
Task state ID |
TASK_UDF_MAP |
Map |
null |
No |
Custom field ID/value pairs |
TASK_PARENT_TASK |
String |
Current task |
No |
Parent task number |
TASK_PARENT_TASK_ID |
String |
Current task |
No |
Parent task ID |
To create a user, put the following data into the resulting Map:
Key |
Value Type |
Default |
Required |
Description |
OBJECT_TYPE |
String |
Must be CSVImport.USER_TYPE |
Yes |
Object type ID |
USER_LOGIN |
String |
"Not specified" + postfix |
No |
User login |
USER_PASSWORD |
String |
None |
No |
User password. No empty password allowed. |
USER_NAME |
String |
"Not specified" |
No |
User name |
USER_PHONE |
String |
null |
No |
User phone |
USER_EMAIL |
String |
null |
No |
User e-mail |
USER_PRSTATUS_ID |
String |
Must be defined |
Yes |
User status ID |
USER_TIMEZONE |
String |
Logged user time zone |
No |
User time zone code |
USER_LOCALE |
String |
Logged user locale |
No |
User locale code |
USER_COMPANY |
String |
null |
No |
User company |
USER_EMAIL_TYPE_ID |
String |
1 - HTML template ID |
No |
User default e-mail template ID |
USER_DEFAULT_PROJECT_ID |
String |
null |
No |
User default project ID |
USER_EXPIRE_DATE |
Calendar |
null |
No |
User expire date |
USER_IS_ACTIVE |
Boolean |
true |
No |
User is active |
USER_SHOW_HELP |
Boolean |
true |
No |
Show inline help |
USER_HTML_EDITOR |
Boolean |
true |
No |
Always use the HTML editor to edit task/message description |
USER_SHOW_TREE_MODE |
Integer |
2- All tasks and users |
No |
Navigation tree show mode: 0 - None 1 - Projects and managers 2 - All tasks and users |
USER_UDF_MAP |
Map |
null |
No |
Custom field ID/value pairs |
USER_PARENT_USER |
String |
Logged user |
No |
Parent user login |
USER_PARENT_USER_ID |
String |
Logged user |
No |
Parent user ID |
To create a message, put the following data into the resulting Map:
Key |
Value Type |
Default |
Required |
Description |
OBJECT_TYPE |
String |
Must be CSVImport.MESSAGE_TYPE |
Yes |
Object type ID |
MESSAGE_TASK_ID |
String |
Must be defined |
Yes |
Task ID |
MESSAGE_MESSAGE_TYPE_ID |
String |
Must be defined |
Yes |
Message type ID |
MESSAGE_DESCRIPTION |
String |
"" |
No |
Message description |
MESSAGE_HOURS |
Double |
null |
No |
Message actual time |
MESSAGE_HANDLER_USER_ID |
String/Map |
null |
No |
Message handler (user) ID/Map |
MESSAGE_HANDLER_GROUP_ID |
String |
null |
No |
Message handler (group) ID/Map |
MESSAGE_RESOLUTION_ID |
String |
null |
No |
Message resolution ID |
MESSAGE_SUBMIT_DATE |
Calendar |
Current date |
No |
Message submit date |
MESSAGE_SUBMITTER_ID |
String/Map |
Logged user |
No |
Message submitter |
MESSAGE_UDF_MAP |
Map |
null |
No |
Custom field ID/value pairs |
To search for the object ID by its name, use the following methods of the CSVImport class:
Method Name |
Arguments |
Returns |
findCategoryIdByName |
Category name |
Category ID |
findPriorityIdByName |
Priority name, Category name |
Priority ID |
findResolutionIdByName |
Resolution name, Message type name |
Resolution ID |
findTaskResolutionIdByName |
Resolution name, Category name |
Resolution ID |
findStateIdByName |
State name, Category name |
State ID |
findTaskIdByName |
Task name |
Task ID |
findTaskIdByNumber |
Task number |
Task ID |
findUserIdByLogin |
User login |
User ID |
findUserIdByName |
User name |
User ID |
findMessageTypeIdByName |
Message type name, Category name |
Message type ID |
findUserStatusIdByName |
User status name |
User status ID |
findUDFIdByName |
Custom field caption |
Custom field ID |
findUDFListIdByValue |
Value of the custom field list |
Value ID |