This resource represents issue worklogs. Use it to:

  • get, create, update, and delete worklogs.
  • obtain lists of updated or deleted worklogs.

Hierarchy

  • CommonHttpService
    • IssueWorklogsService

Constructors

  • Internal

    Create a new instance of the service.

    Parameters

    • getClientInstance: (() => CommonHttpClient)
        • (): CommonHttpClient
        • Returns CommonHttpClient

    Returns IssueWorklogsService

Methods

  • Adds a worklog to an issue.

    Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see Configuring time tracking.

    This operation can be accessed anonymously.

    Permissions required:

    Parameters

    • params: {
          adjustEstimate?:
              | "auto"
              | "new"
              | "manual"
              | "leave";
          expand?: string;
          issueIdOrKey: string;
          newEstimate?: string;
          notifyUsers?: boolean;
          overrideEditableFlag?: boolean;
          reduceBy?: string;
          worklog: Worklog;
      }
      • OptionaladjustEstimate?:
            | "auto"
            | "new"
            | "manual"
            | "leave"

        Defines how to update the issue's time estimate, the options are:

        • new Sets the estimate to a specific value, defined in newEstimate.
        • leave Leaves the estimate unchanged.
        • manual Reduces the estimate by amount specified in reduceBy.
        • auto Reduces the estimate by the value of timeSpent in the worklog.
      • Optionalexpand?: string

        Use expand to include additional information about work logs in the response. This parameter accepts properties, which returns worklog properties.

      • issueIdOrKey: string

        The ID or key the issue.

      • OptionalnewEstimate?: string

        The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For example, 2d. Required when adjustEstimate is new.

      • OptionalnotifyUsers?: boolean

        Whether users watching the issue are notified by email.

      • OptionaloverrideEditableFlag?: boolean

        Whether the worklog entry should be added to the issue even if the issue is not editable, because jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with Administer Jira global permission can use this flag.

      • OptionalreduceBy?: string

        The amount to reduce the issue's remaining estimate by, as days (#d), hours (#h), or minutes (#m). For example, 2d. Required when adjustEstimate is manual.

      • worklog: Worklog

    Returns Promise<Worklog>

    Returned if the request is successful.

    POST /rest/api/3/issue/{issueIdOrKey}/worklog @scopes-current write:jira-work @scopes-beta write:issue-worklog:jira, write:issue-worklog.property:jira, read:avatar:jira, read:group:jira, read:issue-worklog:jira, read:project-role:jira, read:user:jira, read:issue-worklog.property:jira

  • Deletes a list of worklogs from an issue. This is an experimental API with limitations:

    • You can't delete more than 5000 worklogs at once.
    • No notifications will be sent for deleted worklogs.

    Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see Configuring time tracking.

    Permissions required:

    • Browse projects project permission for the project containing the issue.
    • If issue-level security is configured, issue-level security permission to view the issue.
    • Delete all worklogs project permission to delete any worklog.
    • If any worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to.

    Parameters

    • params: {
          adjustEstimate?: "auto" | "leave";
          issueIdOrKey: string;
          overrideEditableFlag?: boolean;
          worklogIdsRequestBean: WorklogIdsRequestBean;
      }
      • OptionaladjustEstimate?: "auto" | "leave"

        Defines how to update the issue's time estimate, the options are:

        • leave Leaves the estimate unchanged.
        • auto Reduces the estimate by the aggregate value of timeSpent across all worklogs being deleted.
      • issueIdOrKey: string

        The ID or key of the issue.

      • OptionaloverrideEditableFlag?: boolean

        Whether the work log entries should be removed to the issue even if the issue is not editable, because jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with admin permission can use this flag.

      • worklogIdsRequestBean: WorklogIdsRequestBean

        A JSON object containing a list of worklog IDs.

    Returns Promise<void>

    DELETE /rest/api/3/issue/{issueIdOrKey}/worklog @scopes-current write:jira-work @scopes-beta delete:issue-worklog:jira, delete:issue-worklog.property:jira, write:issue.time-tracking:jira, read:group:jira, read:issue-worklog:jira, read:project-role:jira, read:user:jira, read:issue-worklog.property:jira

  • Moves a list of worklogs from one issue to another. This is an experimental API with several limitations:

    • You can't move more than 5000 worklogs at once.
    • You can't move worklogs containing an attachment.
    • You can't move worklogs restricted by project roles.
    • No notifications will be sent for moved worklogs.
    • No webhooks or events will be sent for moved worklogs.
    • No issue history will be recorded for moved worklogs.

    Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see Configuring time tracking.

    Permissions required:

    Parameters

    • params: {
          adjustEstimate?: "auto" | "leave";
          issueIdOrKey: string;
          overrideEditableFlag?: boolean;
          worklogsMoveRequestBean: WorklogsMoveRequestBean;
      }
      • OptionaladjustEstimate?: "auto" | "leave"

        Defines how to update the issues' time estimate, the options are:

        • leave Leaves the estimate unchanged.
        • auto Reduces the estimate by the aggregate value of timeSpent across all worklogs being moved in the source issue, and increases it in the destination issue.
      • issueIdOrKey: string
      • OptionaloverrideEditableFlag?: boolean

        Whether the work log entry should be moved to and from the issues even if the issues are not editable, because jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with admin permission can use this flag.

      • worklogsMoveRequestBean: WorklogsMoveRequestBean

        A JSON object containing a list of worklog IDs and the ID or key of the destination issue.

    Returns Promise<void>

    POST /rest/api/3/issue/{issueIdOrKey}/worklog/move @scopes-current write:jira-work @scopes-beta read:issue-worklog:jira, write:issue-worklog:jira, delete:issue-worklog:jira, read:issue-worklog.property:jira, write:issue-worklog.property:jira, delete:issue-worklog.property:jira, write:issue.time-tracking:jira, read:group:jira, read:project-role:jira, read:user:jira

  • Deletes a worklog from an issue.

    Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see Configuring time tracking.

    This operation can be accessed anonymously.

    Permissions required:

    • Browse projects project permission for the project that the issue is in.
    • If issue-level security is configured, issue-level security permission to view the issue.
    • Delete all worklogs project permission to delete any worklog or Delete own worklogs to delete worklogs created by the user,
    • If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to.

    Parameters

    • params: {
          adjustEstimate?:
              | "auto"
              | "new"
              | "manual"
              | "leave";
          id: string;
          increaseBy?: string;
          issueIdOrKey: string;
          newEstimate?: string;
          notifyUsers?: boolean;
          overrideEditableFlag?: boolean;
      }
      • OptionaladjustEstimate?:
            | "auto"
            | "new"
            | "manual"
            | "leave"

        Defines how to update the issue's time estimate, the options are:

        • new Sets the estimate to a specific value, defined in newEstimate.
        • leave Leaves the estimate unchanged.
        • manual Increases the estimate by amount specified in increaseBy.
        • auto Reduces the estimate by the value of timeSpent in the worklog.
      • id: string

        The ID of the worklog.

      • OptionalincreaseBy?: string

        The amount to increase the issue's remaining estimate by, as days (#d), hours (#h), or minutes (#m or #). For example, 2d. Required when adjustEstimate is manual.

      • issueIdOrKey: string

        The ID or key of the issue.

      • OptionalnewEstimate?: string

        The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For example, 2d. Required when adjustEstimate is new.

      • OptionalnotifyUsers?: boolean

        Whether users watching the issue are notified by email.

      • OptionaloverrideEditableFlag?: boolean

        Whether the work log entry should be added to the issue even if the issue is not editable, because jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with admin permission can use this flag.

    Returns Promise<void>

    DELETE /rest/api/3/issue/{issueIdOrKey}/worklog/{id} @scopes-current write:jira-work @scopes-beta delete:issue-worklog:jira, delete:issue-worklog.property:jira, write:issue.time-tracking:jira

  • Returns a list of IDs and delete timestamps for worklogs deleted after a date and time.

    This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to youngest. If the number of items in the date range exceeds 1000, until indicates the timestamp of the youngest item on the page. Also, nextPage provides the URL for the next page of worklogs. The lastPage parameter is set to true on the last page of worklogs.

    This resource does not return worklogs deleted during the minute preceding the request.

    Permissions required: Permission to access Jira.

    Parameters

    • params: {
          since?: number;
      } = {}
      • Optionalsince?: number

        The date and time, as a UNIX timestamp in milliseconds, after which deleted worklogs are returned.

    Returns Promise<ChangedWorklogs>

    Returned if the request is successful.

    example:

    {
    "lastPage": true,
    "nextPage": "https://your-domain.atlassian.net/api/~ver~/worklog/deleted?since=1438013693136",
    "self": "https://your-domain.atlassian.net/api/~ver~/worklog/deleted?since=1438013671562",
    "since": 1438013671562,
    "until": 1438013693136,
    "values": [
    {
    "properties": [],
    "updatedTime": 1438013671562,
    "worklogId": 103
    },
    {
    "properties": [],
    "updatedTime": 1438013672165,
    "worklogId": 104
    },
    {
    "properties": [],
    "updatedTime": 1438013693136,
    "worklogId": 105
    }
    ]
    }

    GET /rest/api/3/worklog/deleted @scopes-current read:jira-work @scopes-beta read:issue-worklog:jira, read:issue-worklog.property:jira

  • Returns a list of IDs and update timestamps for worklogs updated after a date and time.

    This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to youngest. If the number of items in the date range exceeds 1000, until indicates the timestamp of the youngest item on the page. Also, nextPage provides the URL for the next page of worklogs. The lastPage parameter is set to true on the last page of worklogs.

    This resource does not return worklogs updated during the minute preceding the request.

    Permissions required: Permission to access Jira, however, worklogs are only returned where either of the following is true:

    • the worklog is set as Viewable by All Users.
    • the user is a member of a project role or group with permission to view the worklog.

    Parameters

    • params: {
          expand?: string;
          since?: number;
      } = {}
      • Optionalexpand?: string

        Use expand to include additional information about worklogs in the response. This parameter accepts properties that returns the properties of each worklog.

      • Optionalsince?: number

        The date and time, as a UNIX timestamp in milliseconds, after which updated worklogs are returned.

    Returns Promise<ChangedWorklogs>

    Returned if the request is successful.

    example:

    {
    "lastPage": true,
    "nextPage": "https://your-domain.atlassian.net/api/~ver~/worklog/updated?since=1438013693136",
    "self": "https://your-domain.atlassian.net/api/~ver~/worklog/updated?since=1438013671562",
    "since": 1438013671562,
    "until": 1438013693136,
    "values": [
    {
    "properties": [],
    "updatedTime": 1438013671562,
    "worklogId": 103
    },
    {
    "properties": [],
    "updatedTime": 1438013672165,
    "worklogId": 104
    },
    {
    "properties": [],
    "updatedTime": 1438013693136,
    "worklogId": 105
    }
    ]
    }

    GET /rest/api/3/worklog/updated @scopes-current read:jira-work @scopes-beta read:issue-worklog:jira, read:issue-worklog.property:jira

  • Returns worklogs for an issue (ordered by created time), starting from the oldest worklog or from the worklog started on or after a date and time.

    Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see Configuring time tracking.

    This operation can be accessed anonymously.

    Permissions required: Workloads are only returned where the user has:

    • Browse projects project permission for the project that the issue is in.
    • If issue-level security is configured, issue-level security permission to view the issue.
    • If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to.

    Parameters

    • params: {
          expand?: string;
          issueIdOrKey: string;
          maxResults?: number;
          startAt?: number;
          startedAfter?: number;
          startedBefore?: number;
      }
      • Optionalexpand?: string

        Use expand to include additional information about worklogs in the response. This parameter acceptsproperties, which returns worklog properties.

      • issueIdOrKey: string

        The ID or key of the issue.

      • OptionalmaxResults?: number

        The maximum number of items to return per page.

      • OptionalstartAt?: number

        The index of the first item to return in a page of results (page offset).

      • OptionalstartedAfter?: number

        The worklog start date and time, as a UNIX timestamp in milliseconds, after which worklogs are returned.

      • OptionalstartedBefore?: number

        The worklog start date and time, as a UNIX timestamp in milliseconds, before which worklogs are returned.

    Returns Promise<PageOfWorklogs>

    Returned if the request is successful

    example:

    {
    "maxResults": 1,
    "startAt": 0,
    "total": 1,
    "worklogs": [
    {
    "author": {
    "accountId": "5b10a2844c20165700ede21g",
    "active": false,
    "displayName": "Mia Krystof",
    "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
    },
    "comment": {
    "type": "doc",
    "version": 1,
    "content": [
    {
    "type": "paragraph",
    "content": [
    {
    "type": "text",
    "text": "I did some work here."
    }
    ]
    }
    ]
    },
    "id": "100028",
    "issueId": "10002",
    "self": "https://your-domain.atlassian.net/rest/api/3/issue/10010/worklog/10000",
    "started": "2021-01-17T12:34:00.000+0000",
    "timeSpent": "3h 20m",
    "timeSpentSeconds": 12000,
    "updateAuthor": {
    "accountId": "5b10a2844c20165700ede21g",
    "active": false,
    "displayName": "Mia Krystof",
    "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
    },
    "updated": "2021-01-18T23:45:00.000+0000",
    "visibility": {
    "identifier": "276f955c-63d7-42c8-9520-92d01dca0625",
    "type": "group",
    "value": "jira-developers"
    }
    }
    ]
    }

    GET /rest/api/3/issue/{issueIdOrKey}/worklog @scopes-current read:jira-work @scopes-beta read:group:jira, read:issue-worklog:jira, read:issue-worklog.property:jira, read:project-role:jira, read:user:jira, read:avatar:jira

  • Returns a worklog.

    Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see Configuring time tracking.

    This operation can be accessed anonymously.

    Permissions required:

    • Browse projects project permission for the project that the issue is in.
    • If issue-level security is configured, issue-level security permission to view the issue.
    • If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to.

    Parameters

    • params: {
          expand?: string;
          id: string;
          issueIdOrKey: string;
      }
      • Optionalexpand?: string

        Use expand to include additional information about work logs in the response. This parameter accepts

        properties, which returns worklog properties.

      • id: string

        The ID of the worklog.

      • issueIdOrKey: string

        The ID or key of the issue.

    Returns Promise<Worklog>

    Returned if the request is successful.

    example:

    {
    "author": {
    "accountId": "5b10a2844c20165700ede21g",
    "active": false,
    "displayName": "Mia Krystof",
    "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
    },
    "comment": {
    "type": "doc",
    "version": 1,
    "content": [
    {
    "type": "paragraph",
    "content": [
    {
    "type": "text",
    "text": "I did some work here."
    }
    ]
    }
    ]
    },
    "id": "100028",
    "issueId": "10002",
    "self": "https://your-domain.atlassian.net/rest/api/3/issue/10010/worklog/10000",
    "started": "2021-01-17T12:34:00.000+0000",
    "timeSpent": "3h 20m",
    "timeSpentSeconds": 12000,
    "updateAuthor": {
    "accountId": "5b10a2844c20165700ede21g",
    "active": false,
    "displayName": "Mia Krystof",
    "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
    },
    "updated": "2021-01-18T23:45:00.000+0000",
    "visibility": {
    "identifier": "276f955c-63d7-42c8-9520-92d01dca0625",
    "type": "group",
    "value": "jira-developers"
    }
    }

    GET /rest/api/3/issue/{issueIdOrKey}/worklog/{id} @scopes-current read:jira-work @scopes-beta read:comment:jira, read:group:jira, read:issue-worklog:jira, read:issue-worklog.property:jira, read:project-role:jira, read:user:jira, read:avatar:jira

  • Returns worklog details for a list of worklog IDs.

    The returned list of worklogs is limited to 1000 items.

    Permissions required: Permission to access Jira, however, worklogs are only returned where either of the following is true:

    • the worklog is set as Viewable by All Users.
    • the user is a member of a project role or group with permission to view the worklog.

    Parameters

    • params: {
          expand?: string;
          worklogIdsRequestBean: WorklogIdsRequestBean;
      }
      • Optionalexpand?: string

        Use expand to include additional information about worklogs in the response. This parameter accepts properties that returns the properties of each worklog.

      • worklogIdsRequestBean: WorklogIdsRequestBean

        A JSON object containing a list of worklog IDs.

    Returns Promise<Worklog[]>

    Returned if the request is successful.

    example:

    [
    {
    "author": {
    "accountId": "5b10a2844c20165700ede21g",
    "active": false,
    "displayName": "Mia Krystof",
    "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
    },
    "comment": {
    "type": "doc",
    "version": 1,
    "content": [
    {
    "type": "paragraph",
    "content": [
    {
    "type": "text",
    "text": "I did some work here."
    }
    ]
    }
    ]
    },
    "id": "100028",
    "issueId": "10002",
    "self": "https://your-domain.atlassian.net/rest/api/3/issue/10010/worklog/10000",
    "started": "2021-01-17T12:34:00.000+0000",
    "timeSpent": "3h 20m",
    "timeSpentSeconds": 12000,
    "updateAuthor": {
    "accountId": "5b10a2844c20165700ede21g",
    "active": false,
    "displayName": "Mia Krystof",
    "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
    },
    "updated": "2021-01-18T23:45:00.000+0000",
    "visibility": {
    "identifier": "276f955c-63d7-42c8-9520-92d01dca0625",
    "type": "group",
    "value": "jira-developers"
    }
    }
    ]

    POST /rest/api/3/worklog/list @scopes-current read:jira-work @scopes-beta read:comment:jira, read:group:jira, read:issue-worklog:jira, read:issue-worklog.property:jira, read:project-role:jira, read:user:jira, read:avatar:jira

  • Updates a worklog.

    Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see Configuring time tracking.

    This operation can be accessed anonymously.

    Permissions required:

    • Browse projects project permission for the project that the issue is in.
    • If issue-level security is configured, issue-level security permission to view the issue.
    • Edit all worklogs project permission to update any worklog or Edit own worklogs to update worklogs created by the user.
    • If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to.

    Parameters

    • params: {
          adjustEstimate?:
              | "auto"
              | "new"
              | "manual"
              | "leave";
          expand?: string;
          id: string;
          issueIdOrKey: string;
          newEstimate?: string;
          notifyUsers?: boolean;
          overrideEditableFlag?: boolean;
          worklog: Worklog;
      }
      • OptionaladjustEstimate?:
            | "auto"
            | "new"
            | "manual"
            | "leave"

        Defines how to update the issue's time estimate, the options are:

        • new Sets the estimate to a specific value, defined in newEstimate.
        • leave Leaves the estimate unchanged.
        • auto Updates the estimate by the difference between the original and updated value of timeSpent or timeSpentSeconds.
      • Optionalexpand?: string

        Use expand to include additional information about worklogs in the response. This parameter accepts properties, which returns worklog properties.

      • id: string

        The ID of the worklog.

      • issueIdOrKey: string

        The ID or key the issue.

      • OptionalnewEstimate?: string

        The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For example, 2d. Required when adjustEstimate is new.

      • OptionalnotifyUsers?: boolean

        Whether users watching the issue are notified by email.

      • OptionaloverrideEditableFlag?: boolean

        Whether the worklog should be added to the issue even if the issue is not editable. For example, because the issue is closed. Connect and Forge app users with Administer Jira global permission can use this flag.

      • worklog: Worklog

    Returns Promise<Worklog>

    Returned if the request is successful

    example:

    {
    "author": {
    "accountId": "5b10a2844c20165700ede21g",
    "active": false,
    "displayName": "Mia Krystof",
    "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
    },
    "comment": {
    "type": "doc",
    "version": 1,
    "content": [
    {
    "type": "paragraph",
    "content": [
    {
    "type": "text",
    "text": "I did some work here."
    }
    ]
    }
    ]
    },
    "id": "100028",
    "issueId": "10002",
    "self": "https://your-domain.atlassian.net/rest/api/3/issue/10010/worklog/10000",
    "started": "2021-01-17T12:34:00.000+0000",
    "timeSpent": "3h 20m",
    "timeSpentSeconds": 12000,
    "updateAuthor": {
    "accountId": "5b10a2844c20165700ede21g",
    "active": false,
    "displayName": "Mia Krystof",
    "self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g"
    },
    "updated": "2021-01-18T23:45:00.000+0000",
    "visibility": {
    "identifier": "276f955c-63d7-42c8-9520-92d01dca0625",
    "type": "group",
    "value": "jira-developers"
    }
    }

    PUT /rest/api/3/issue/{issueIdOrKey}/worklog/{id} @scopes-current write:jira-work @scopes-beta read:comment:jira, read:group:jira, read:issue-worklog:jira, read:issue-worklog.property:jira, read:project-role:jira, read:user:jira, write:comment:jira, write:issue-worklog:jira, write:issue-worklog.property:jira, read:avatar:jira

  • Method to initialize the class. Normally used to set up validation rules.

    Returns void