Skip to content

Function: updateWorklog() ​

ts
function updateWorklog(
   client, 
   parameters, 
   options?
): Promise<{
[key: string]: unknown;
  author?: {
   [key: string]: unknown;
     accountId?: string;
     accountType?: string;
     active?: boolean;
     avatarUrls?: {
      [key: string]: unknown;
        16x16?: string;
        24x24?: string;
        32x32?: string;
        48x48?: string;
     };
     displayName?: string;
     emailAddress?: string;
     self?: string;
     timeZone?: string;
  };
  comment?: {
   [key: string]: unknown;
     content: Record<string, any>[];
     type: string & object | "doc";
     version: number;
  };
  created?: Date;
  id?: string;
  issueId?: string;
  properties?: object[];
  self?: string;
  started?: Date;
  timeSpent?: string;
  timeSpentSeconds?: number;
  updateAuthor?: {
   [key: string]: unknown;
     accountId?: string;
     accountType?: string;
     active?: boolean;
     avatarUrls?: {
      [key: string]: unknown;
        16x16?: string;
        24x24?: string;
        32x32?: string;
        48x48?: string;
     };
     displayName?: string;
     emailAddress?: string;
     self?: string;
     timeZone?: string;
  };
  updated?: Date;
  visibility?: {
   [key: string]: unknown;
     identifier?: string | null;
     type?: "role" | "group" | string & object;
     value?: string;
  };
}>;

Defined in: src/cloud/api/issueWorklogs.ts:177

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 ​

ParameterTypeDescription
clientClient-
parameters{ adjustEstimate?: "auto" | "manual" | "new" | string & object | "leave"; body: { author?: { accountId?: string; accountType?: string; active?: boolean; avatarUrls?: { 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; }; displayName?: string; emailAddress?: string; self?: string; timeZone?: string; }; comment?: | string | { content: Record<string, any>[]; type: string & object | "doc"; version: number; }; created?: unknown; id?: string; issueId?: string; properties?: object[]; self?: string; started?: unknown; timeSpent?: string; timeSpentSeconds?: number; updateAuthor?: { accountId?: string; accountType?: string; active?: boolean; avatarUrls?: { 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; }; displayName?: string; emailAddress?: string; self?: string; timeZone?: string; }; updated?: unknown; visibility?: { identifier?: string | null; type?: "role" | "group" | string & object; value?: string; }; }; expand?: | "properties" | string & object | ("properties" | string & object)[]; id: string; issueIdOrKey: string; newEstimate?: string; notifyUsers?: boolean; overrideEditableFlag?: boolean; }-
parameters.adjustEstimate?"auto" | "manual" | "new" | string & object | "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.
parameters.body?{ author?: { accountId?: string; accountType?: string; active?: boolean; avatarUrls?: { 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; }; displayName?: string; emailAddress?: string; self?: string; timeZone?: string; }; comment?: | string | { content: Record<string, any>[]; type: string & object | "doc"; version: number; }; created?: unknown; id?: string; issueId?: string; properties?: object[]; self?: string; started?: unknown; timeSpent?: string; timeSpentSeconds?: number; updateAuthor?: { accountId?: string; accountType?: string; active?: boolean; avatarUrls?: { 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; }; displayName?: string; emailAddress?: string; self?: string; timeZone?: string; }; updated?: unknown; visibility?: { identifier?: string | null; type?: "role" | "group" | string & object; value?: string; }; }-
parameters.body.author?{ accountId?: string; accountType?: string; active?: boolean; avatarUrls?: { 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; }; displayName?: string; emailAddress?: string; self?: string; timeZone?: string; }-
parameters.body.author.accountId?stringThe account ID of the user, which uniquely identifies the user across all Atlassian products. For example, 5b10ac8d82e05b22cc7d4ef5.
parameters.body.author.accountType?stringThe type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application user) or 'customer' (Jira Service Desk customer user)
parameters.body.author.active?booleanWhether the user is active.
parameters.body.author.avatarUrls?{ 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; }-
parameters.body.author.avatarUrls.16x16?stringThe URL of the item's 16x16 pixel avatar.
parameters.body.author.avatarUrls.24x24?stringThe URL of the item's 24x24 pixel avatar.
parameters.body.author.avatarUrls.32x32?stringThe URL of the item's 32x32 pixel avatar.
parameters.body.author.avatarUrls.48x48?stringThe URL of the item's 48x48 pixel avatar.
parameters.body.author.displayName?stringThe display name of the user. Depending on the user’s privacy settings, this may return an alternative value.
parameters.body.author.emailAddress?stringThe email address of the user. Depending on the user’s privacy settings, this may be returned as null.
parameters.body.author.self?stringThe URL of the user.
parameters.body.author.timeZone?stringThe time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as null.
parameters.body.comment?| string | { content: Record<string, any>[]; type: string & object | "doc"; version: number; }A document in Atlassian Document Format, or a string of wiki markup — a string is sent to the v2 endpoint that parses it, and the result is read back as a document.
parameters.body.created?unknownThe datetime on which the worklog was created.
parameters.body.id?stringThe ID of the worklog record.
parameters.body.issueId?stringThe ID of the issue this worklog is for.
parameters.body.properties?object[]Details of properties for the worklog. Optional when creating or updating a worklog.
parameters.body.self?stringThe URL of the worklog item.
parameters.body.started?unknownThe datetime on which the worklog effort was started. Required when creating a worklog. Optional when updating a worklog.
parameters.body.timeSpent?stringThe time spent working on the issue as days (#d), hours (#h), or minutes (#m or #). Required when creating a worklog if timeSpentSeconds isn't provided. Optional when updating a worklog. Cannot be provided if timeSpentSecond is provided.
parameters.body.timeSpentSeconds?numberThe time in seconds spent working on the issue. Required when creating a worklog if timeSpent isn't provided. Optional when updating a worklog. Cannot be provided if timeSpent is provided.
parameters.body.updateAuthor?{ accountId?: string; accountType?: string; active?: boolean; avatarUrls?: { 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; }; displayName?: string; emailAddress?: string; self?: string; timeZone?: string; }-
parameters.body.updateAuthor.accountId?stringThe account ID of the user, which uniquely identifies the user across all Atlassian products. For example, 5b10ac8d82e05b22cc7d4ef5.
parameters.body.updateAuthor.accountType?stringThe type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application user) or 'customer' (Jira Service Desk customer user)
parameters.body.updateAuthor.active?booleanWhether the user is active.
parameters.body.updateAuthor.avatarUrls?{ 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; }-
parameters.body.updateAuthor.avatarUrls.16x16?stringThe URL of the item's 16x16 pixel avatar.
parameters.body.updateAuthor.avatarUrls.24x24?stringThe URL of the item's 24x24 pixel avatar.
parameters.body.updateAuthor.avatarUrls.32x32?stringThe URL of the item's 32x32 pixel avatar.
parameters.body.updateAuthor.avatarUrls.48x48?stringThe URL of the item's 48x48 pixel avatar.
parameters.body.updateAuthor.displayName?stringThe display name of the user. Depending on the user’s privacy settings, this may return an alternative value.
parameters.body.updateAuthor.emailAddress?stringThe email address of the user. Depending on the user’s privacy settings, this may be returned as null.
parameters.body.updateAuthor.self?stringThe URL of the user.
parameters.body.updateAuthor.timeZone?stringThe time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as null.
parameters.body.updated?unknownThe datetime on which the worklog was last updated.
parameters.body.visibility?{ identifier?: string | null; type?: "role" | "group" | string & object; value?: string; }-
parameters.body.visibility.identifier?string | nullThe ID of the group or the name of the role that visibility of this item is restricted to.
parameters.body.visibility.type?"role" | "group" | string & objectWhether visibility of this item is restricted to a group or role.
parameters.body.visibility.value?stringThe name of the group or role that visibility of this item is restricted to. Please note that the name of a group is mutable, to reliably identify a group use identifier.
parameters.expand?| "properties" | string & object | ("properties" | string & object)[]Use expand to include additional information about worklogs in the response. This parameter accepts properties, which returns worklog properties.
parameters.id?stringThe ID of the worklog.
parameters.issueIdOrKey?stringThe ID or key the issue.
parameters.newEstimate?stringThe 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.
parameters.notifyUsers?booleanWhether users watching the issue are notified by email.
parameters.overrideEditableFlag?booleanWhether 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.
options?RequestOptions-

Returns ​

Promise<{ [key: string]: unknown; author?: { [key: string]: unknown; accountId?: string; accountType?: string; active?: boolean; avatarUrls?: { [key: string]: unknown; 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; }; displayName?: string; emailAddress?: string; self?: string; timeZone?: string; }; comment?: { [key: string]: unknown; content: Record<string, any>[]; type: string & object | "doc"; version: number; }; created?: Date; id?: string; issueId?: string; properties?: object[]; self?: string; started?: Date; timeSpent?: string; timeSpentSeconds?: number; updateAuthor?: { [key: string]: unknown; accountId?: string; accountType?: string; active?: boolean; avatarUrls?: { [key: string]: unknown; 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; }; displayName?: string; emailAddress?: string; self?: string; timeZone?: string; }; updated?: Date; visibility?: { [key: string]: unknown; identifier?: string | null; type?: "role" | "group" | string & object; value?: string; }; }>