CreatePrimaryItem

Description

This service creates a single primary item within the same project using the data that is supplied.

Arguments

Argument Type Description
auth (optional) Auth The Auth type supplies credentials and optionally, a host name for licensing. The userId and password can be specified with HTTP BASIC or WS-SECURITY instead.
project (required) ProjectIdentifier The project in which the new item will be created. You must at least specify the TS_ID of the project.
parentItem ItemIdentifier If specified, the item that is created using CreatePrimaryItem will become a sub-item of this item.
item (required) TTItem Holds one the item to be created. The TTItem type holds the generic data for the item.
submitTransition (optional) TransitionIdentifier Only used if you want to use an alternate submit transition.
options (optional) ResponseItemOptions Enables you to limit the data that is returned in the response.

Response

TTItemHolder is returned for the item that is specified in the call. The new primary item is returned with updated item data, which shows the unique TS_ID of the record and the TS_ID of the table to which it was added. For more detail, see TTItemHolder.

Usage

The CreatePrimaryItem call provides a method to add a single new record to a given primary table. You can add new records to both custom and system primary tables, given the proper privileges.

To create notes, item links, and URL attachments on the new primary item, add records to these elements as defined in TTItem. To create a file attachment, see CreateFileAttachment.
Tip: You must have the table ID and item ID of the primary item prior to attaching a file to the item because the IDs are required in the ItemIdentifier argument of CreateFileAttachment.

Use the following elements in the options parameter to control how this call is processed and what data is returned:

For more information on the options elements, see ResponseItemOptions.

Faults

XML

The following XML is a snippet of the payload that is sent with CreatePrimaryItem.

<urn:CreatePrimaryItem>
    <urn:auth>
        <urn:userId>admin</urn:userId>
        <urn:password></urn:password>
        <urn:hostname></urn:hostname>
        <urn:loginAsUserId></urn:loginAsUserId>
    </urn:auth>
    <urn:project>
        <urn:displayName>Animation Pro</urn:displayName>
        <urn:id>2</urn:id>
        <urn:uuid></urn:uuid>
        <urn:fullyQualifiedName>Base Project||Base IDT Project||
        Software Development||Animation Pro</urn:fullyQualifiedName>
    </urn:project>
    <urn:parentItem>
    </urn:parentItem>
    <urn:item>
        <urn:id>
            <urn:displayName></urn:displayName>
            <urn:id></urn:id>
            <urn:uuid></urn:uuid>
            <urn:tableId></urn:tableId>
            <urn:tableIdItemId></urn:tableIdItemId>
            <urn:issueId></urn:issueId>
        </urn:id>
        <urn:itemType></urn:itemType>
        <urn:project>
            <urn:displayName></urn:displayName>
            <urn:id></urn:id>
            <urn:uuid></urn:uuid>
            <urn:fullyQualifiedName></urn:fullyQualifiedName>
        </urn:project>
        <urn:title>Test item</urn:title>
        <urn:description>This is a test item.</urn:description>
        <urn:createdBy>
            <urn:displayName></urn:displayName>
            <urn:id></urn:id>
            <urn:uuid></urn:uuid>
            <urn:loginId></urn:loginId>
        </urn:createdBy>
        <urn:createDate></urn:createDate>
        <urn:modifiedBy>
            <urn:displayName></urn:displayName>
            <urn:id></urn:id>
            <urn:uuid></urn:uuid>
            <urn:loginId></urn:loginId>
        </urn:modifiedBy>
        <urn:modifiedDate></urn:modifiedDate>
        <urn:activeInactive></urn:activeInactive>
        <urn:state>
            <urn:displayName></urn:displayName>
            <urn:id></urn:id>
            <urn:uuid></urn:uuid>
            <urn:isClosed></urn:isClosed>
        </urn:state>
        <urn:owner>
            <urn:displayName></urn:displayName>
            <urn:id></urn:id>
            <urn:uuid></urn:uuid>
            <urn:loginId></urn:loginId>
        </urn:owner>
        <urn:url/>
        <urn:subtasks/>
        <urn:extendedField>
            <urn:id>
                <urn:displayName>Severity</urn:displayName>
                <urn:id></urn:id>
                <urn:uuid></urn:uuid>
                <urn:dbName>SEVERITY</urn:dbName>
            </urn:id>
            <urn:setValueBy>DISPLAY-VALUE</urn:setValueBy>
            <urn:setValueMethod>REPLACE-VALUES</urn:setValueMethod>
            <urn:value>
                <urn:displayValue>Critical</urn:displayValue>
                <urn:internalValue></urn:internalValue>
                <urn:uuid></urn:uuid>
            </urn:value>
        </urn:extendedField>
        <urn:extendedField>
            <urn:id>
                <urn:displayName>How Found</urn:displayName>
                <urn:id>74</urn:id>
                <urn:uuid>b999082f-ef27-47c9-890f-b4d80a3c4c23</urn:uuid>
                <urn:dbName>HOW_FOUND</urn:dbName>
            </urn:id>
            <urn:setValueBy>INTERNAL-VALUE</urn:setValueBy>
            <urn:setValueMethod>REPLACE-VALUES</urn:setValueMethod>
            <urn:value>
                <urn:displayValue>Code Review</urn:displayValue>
                <urn:internalValue>24</urn:internalValue>
                <urn:uuid>931259b4-dc0a-46c5-b567-ff04dd5c9395</urn:uuid>
            </urn:value>
        </urn:extendedField>
        <urn:extendedData>
            <urn:data>
                <urn:name></urn:name>
                <urn:value></urn:value>
            </urn:data>
        </urn:extendedData>
    </urn:item>
    <urn:submitTransition>
        <urn:displayName></urn:displayName>
        <urn:id></urn:id>
        <urn:uuid></urn:uuid>
    </urn:submitTransition>
    <urn:options>
        <urn:extraOption>
            <urn:name></urn:name>
            <urn:value></urn:value>
        </urn:extraOption>
        <urn:sections>SECTIONS-ALL</urn:sections>
        <urn:specifiedSections></urn:specifiedSections>
        <urn:limitedField/>
    </urn:options>
</urn:CreatePrimaryItem>