Item Time Log Endpoint

Get

This method returns a Time Log of a specific Item.

Get/api/items/{itemid}/times/{timeid}

The URL must have the Item Id and Time Id. It returns an IssueTimeTrackingDto.

Microsoft.NET example:

IssueTimeTrackingDto itemTime = serviceManager.Item.GetTime(36, 103);

JavaScript example:

var geminiUrl = "http://localhost/gemini/api/items/36/times/103";
var geminiUsername = Base64.encode("manager:xvitjc5bmm"); // user : apikey

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

Get All

This method returns all Time Logs of a specific Item.

Get/api/items/{itemid}/times

It returns a list of IssueTimeTrackingDto's.

Microsoft.NET example:

List<IssueTimeTracking> itemTimes = serviceManager.Item.GetTimes(36);

JavaScript example:

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

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

Create

This method creates a new Time Log.

POST/api/items/{itemid}/times

The request body must contain the IssueTimeTracking Entity. The return value is a new IssueTimeTrackingDto where the IssueTimeTracking Id field is populated.

Microsoft.NET example:

var time = new IssueTimeTracking();

time.ProjectId = 17;
time.IssueId = 36;
time.UserId = 1;
time.Comment = "Worked through lunch";
time.Hours = 3;
time.Minutes = 25;
time.EntryDate = System.DateTime.Now;

serviceManager.Item.LogTime(time);

JavaScript example:

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

var geminiData = {
    ProjectId: "17",
    IssueId: "36",
    UserId: "1",
    Comment: "Worked through lunch",
    Hours: "3",
    Minutes: "25",
    EntryDate: "11/01/2013"
}

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

Update

This method updates an existing Time Log.

PUT/api/items/{itemid}/times

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

Microsoft.NET example:

IssueTimeTrackingDto data = new IssueTimeTrackingDto();

data.Entity.Id = 64;
data.Entity.ProjectId = 17;
data.Entity.IssueId = 36;
data.Entity.UserId = 1;
data.Entity.Comment = "Worked through lunch and 15 minutes break";
data.Entity.Hours = 3;
data.Entity.Minutes = 25;
data.Entity.EntryDate = System.DateTime.Now;

serviceManager.Item.LogTime(data.Entity);

JavaScript example:

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

var geminiData = {
    Id: "64",
    ProjectId: "17",
    IssueId: "36",
    UserId: "1",
    Comment: "Worked through lunch and 15 minutes break",
    Hours: "3",
    Minutes: "25",
    EntryDate: "11/01/2013"
}

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

Delete

This method deletes a Time Log

DELETE/api/items/{itemid}/times/{timeid}

The URL must contain the Item Id and Time Id.

Microsoft.NET example:

serviceManager.Item.IssueTimeDelete(36, 64);

JavaScript example:

var geminiUrl = "http://localhost/gemini/api/items/36/times/64;
var geminiUsername = Base64.encode("manager:xvitjc5bmm"); // user : apikey

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