Item Custom Field Data Endpoint

Create

This method creates a new Custom Field Data entry.

POST/api/items/{itemid}/customfield/data

The request body must contain the CustomFieldData entity. The return value is a new CustomFieldData entity where the CustomFieldData Id field is populated.

Microsoft.NET example:

CustomFieldData customData = new CustomFieldData();

customData.ProjectId = 17;
customData.IssueId = 36;
customData.UserId = 1;           
customData.CustomFieldId = 46;
customData.Data = "value1";

serviceManager.Item.CustomFieldDataCreate(customData);

JavaScript example:

var geminiUrl = "http://localhost/gemini/api/items/36/customfield/data";
var geminiLogin = Base64.encode("manager:xvitjc5bmm"); // user:apikey

var geminiData = {
    ProjectId: "17",
    IssueId: "36",
    UserId: "1",
    CustomFieldId:"46",
    Data: "value1"  
}

$.ajax({
    url: geminiUrl,
    type: "POST",
    data: geminiData,
    headers: { "Authorization": "Basic " + geminiLogin },
    success: function (data) {
      alert('Success!');
    }
});

Update

This method updates an existing Custom Field Data.

PUT/api/items/{itemid}}/customfield/data

The request body must contain the CustomFieldData entity including the Id. The return value is the updated CustomFieldData entity.

Microsoft.NET example:

CustomFieldData customData = new CustomFieldData();

customData.Id = 219;
customData.ProjectId = 17;
customData.IssueId = 36;
customData.UserId = 1;
customData.CustomFieldId = 46;
customData.Data = "value1";

serviceManager.Item.CustomFieldDataUpdate(customData);

JavaScript example:

var geminiUrl = "http://localhost/gemini/api/items/36/customfield/data";
var geminiLogin = Base64.encode("manager:xvitjc5bmm"); // user:apikey

var geminiData = {
    Id: "219",
    ProjectId: "17",
    IssueId: "36",
    UserId: "1",
    Data: "value2",
    CustomFieldId: "46"
}

$.ajax({
    url: geminiUrl,
    type: "PUT",
    data: geminiData,
    headers: { "Authorization": "Basic " + geminiLogin },
    success: function (data) {
      alert('Success!');
    }
});