API

ictime API

Since version 4.2, ictime supports that selected functionality and data is exposed as part of a separate add-onhttps://marketplace.atlassian.com/plugins/de.iconcept.icbiz.jira-icbiz/server/overview

JIRA API

ictime Custom Log Work Field & JIRA API

As the custom field provided by ictime to log work as part of workflow transition screens (Custom Field Log Work for ictime) is logically a part of JIRA, you can use the JIRA REST API (https://developer.atlassian.com/display/JIRADEV/JIRA+REST+APIs) to work with this field (e.g. to log work as kind of API-driven, automated workflow transitions).

This option is available since ictime 4.0.4. Previous versions do not support using the JIRA REST API.

Work Log Attribute (WLA) functionality (see Work Log Attributes (WLA)) is currently not supported via the JIRA REST API!


Please have a look at the following example (use the JIRA REST API browser to test: https://developer.atlassian.com/display/DOCS/Using+the+REST+API+Browser):

{
  "update": {
    "comment": [
      {
        "add": {
          "body": "."
        }
      }
    ]
  },
  "fields": {
    "customfield_10100":"activateLogwork==true||nocharge==on||noChargeInfo==why this should not be charged||timeSpentCorrected==5h||adjustEstimate==new||newEstimate==5w||activity==3||startDate==Sep 29, 2014 9:34 AM||startTime==5:05 PM||endTime==5:07 PM||comment==my worklog description||issueKey==ABCD-239||logWorkOption==summary||timeLogged==6h||activateLogwork==true||",
    "assignee": {
      "name": "bob"
    },
    "resolution": {
      "name": "Fixed"
    }
  },
  "transition": {
    "id": "5"
  }
}

Custom field ID for the ictime "Log work" field will be different for your JIRA installation, as well as time & date formats might be.

ParameterDescriptionRemarks

"comment"

JIRA comment

Mandatory.

Please note that JIRA usually expects the "comment" field populated. If you fill in something here, it will be displayed in the comment section of the issue. The example above just fills in a "." to avoid that the work log description appears in the comments.

"activity"ID of the activity type in ictimeOptional, only if you use the feature.
"timeLogged"Result (time logged). Expects the format defined in JIRA.Required if logWorkOption is "summary"
"startTime"Start time for your work log. Expects the format defined in JIRA.Required if logWorkOption is "fromTo"
"endTime"End time for your work log. Expects the format defined in JIRA.Required if logWorkOption is "fromTo"
"startDate"Date. Expects the format defined in JIRA.Mandatory.
"logWorkOption"
  • "summary":log work a a result
  • "fromTo": log work with start/end time
One of both option must be selected. Depending on the option selected, you need to set "timeLogged" or "startTime" and "endTime".
"nocharge""on" if this entry should not be chargedOptional, only if you use the feature.
"noChargeInfo"Optional information if a work log should not be charged ("nocharge" is "on").Optional, only if you use the feature.
"timeSpentCorrected"The corrected amount of time (to be charged instead of the time resulting from "timeLogged" (or "startTime" and "endTime"). The other values are still required.Optional, only if you use the feature.
"adjustEstimate"

JIRA options to handle an existing extimate.

  • "new"
  • "auto"
  • "manual"
Default is "auto".
"newEstimate"If "adjustEstimate" is "new". Expects the format defined in JIRA.

"adjustmentAmount"

If "adjustEstimate" is "manual". Expects the format defined in JIRA.
"issueKey"Issue key.Mandatory.
"activateLogwork"required, since 5.7.7.0must be set to true since version 5.7.7.0, NOT required in Version 5.8.3.15 (ONLY)

JIRA and ictime error handling is available, you should get meaningful error responses.


Example Test using Rest Browser

  • Install Atlassian Plugin: Atlassian Rest API Browser
  • Go to API Browser
  • search for rest/api/2/issue/{issueIdOrKey}/transitions rest service
  • use POST tab
  • provide IssueIdOrKey as path parameter (this is just from Jira to perform transition)
  • provide icTime work log / time entry parameters through YOUR custom field in fields section of Json data. Id of customer field depends on your installation


Validation

In case validation of data fails, you will get - in most cases - a result response which shows the error:

You will get a "null" response In case there was no work log created (but validation did not fail) or the work log creation was successful. In case work log should be created, but was not created, you may enable icTime debugging for:

  • de.iconcept.ictime.customfields.TimeEntryCF
  • de.iconcept.ictime.services.timeentry

via Jira Logging to get more detailed results. If a work log was created successfully, you will find an entry with "WORKLOG CREATED VIA TimeEnty CF" in your logs.

Not providing an issueKey or providing an issueKey not equal to the issue key provided to the transaction via path parameter of the rest call may result in unpredictable behvior.