jira.js
    Preparing search index...

    Function updateWorklog

    • 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

      • client: Client
      • parameters: {
            adjustEstimate?: "auto" | "manual" | "new" | string & {} | "leave";
            body: {
                author?: {
                    accountId?: string;
                    accountType?: string;
                    active?: boolean;
                    avatarUrls?: {
                        "16x16"?: string;
                        "24x24"?: string;
                        "32x32"?: string;
                        "48x48"?: string;
                        [key: string]: unknown;
                    };
                    displayName?: string;
                    emailAddress?: string;
                    self?: string;
                    timeZone?: string;
                    [key: string]: unknown;
                };
                comment?: | string
                | {
                    content: Record<string, any>[];
                    type: string & {} | "doc";
                    version: number;
                    [key: string]: unknown;
                };
                created?: unknown;
                id?: string;
                issueId?: string;
                properties?: { key?: string; value?: unknown; [key: string]: unknown }[];
                self?: string;
                started?: unknown;
                timeSpent?: string;
                timeSpentSeconds?: number;
                updateAuthor?: {
                    accountId?: string;
                    accountType?: string;
                    active?: boolean;
                    avatarUrls?: {
                        "16x16"?: string;
                        "24x24"?: string;
                        "32x32"?: string;
                        "48x48"?: string;
                        [key: string]: unknown;
                    };
                    displayName?: string;
                    emailAddress?: string;
                    self?: string;
                    timeZone?: string;
                    [key: string]: unknown;
                };
                updated?: unknown;
                visibility?: {
                    identifier?: string
                    | null;
                    type?: "role" | "group" | string & {};
                    value?: string;
                    [key: string]: unknown;
                };
                [key: string]: unknown;
            };
            expand?: string
            | string[]
            | string & {}
            | ("properties" | string & {})[];
            id: string;
            issueIdOrKey: string;
            newEstimate?: string;
            notifyUsers?: boolean;
            overrideEditableFlag?: boolean;
        }
        • OptionaladjustEstimate?: "auto" | "manual" | "new" | string & {} | "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.
        • body: {
              author?: {
                  accountId?: string;
                  accountType?: string;
                  active?: boolean;
                  avatarUrls?: {
                      "16x16"?: string;
                      "24x24"?: string;
                      "32x32"?: string;
                      "48x48"?: string;
                      [key: string]: unknown;
                  };
                  displayName?: string;
                  emailAddress?: string;
                  self?: string;
                  timeZone?: string;
                  [key: string]: unknown;
              };
              comment?: | string
              | {
                  content: Record<string, any>[];
                  type: string & {} | "doc";
                  version: number;
                  [key: string]: unknown;
              };
              created?: unknown;
              id?: string;
              issueId?: string;
              properties?: { key?: string; value?: unknown; [key: string]: unknown }[];
              self?: string;
              started?: unknown;
              timeSpent?: string;
              timeSpentSeconds?: number;
              updateAuthor?: {
                  accountId?: string;
                  accountType?: string;
                  active?: boolean;
                  avatarUrls?: {
                      "16x16"?: string;
                      "24x24"?: string;
                      "32x32"?: string;
                      "48x48"?: string;
                      [key: string]: unknown;
                  };
                  displayName?: string;
                  emailAddress?: string;
                  self?: string;
                  timeZone?: string;
                  [key: string]: unknown;
              };
              updated?: unknown;
              visibility?: {
                  identifier?: string
                  | null;
                  type?: "role" | "group" | string & {};
                  value?: string;
                  [key: string]: unknown;
              };
              [key: string]: unknown;
          }
          • Optionalauthor?: {
                accountId?: string;
                accountType?: string;
                active?: boolean;
                avatarUrls?: {
                    "16x16"?: string;
                    "24x24"?: string;
                    "32x32"?: string;
                    "48x48"?: string;
                    [key: string]: unknown;
                };
                displayName?: string;
                emailAddress?: string;
                self?: string;
                timeZone?: string;
                [key: string]: unknown;
            }
            • OptionalaccountId?: string

              The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, 5b10ac8d82e05b22cc7d4ef5.

            • OptionalaccountType?: string

              The 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)

            • Optionalactive?: boolean

              Whether the user is active.

            • OptionalavatarUrls?: {
                  "16x16"?: string;
                  "24x24"?: string;
                  "32x32"?: string;
                  "48x48"?: string;
                  [key: string]: unknown;
              }
              • Optional16x16?: string

                The URL of the item's 16x16 pixel avatar.

              • Optional24x24?: string

                The URL of the item's 24x24 pixel avatar.

              • Optional32x32?: string

                The URL of the item's 32x32 pixel avatar.

              • Optional48x48?: string

                The URL of the item's 48x48 pixel avatar.

            • OptionaldisplayName?: string

              The display name of the user. Depending on the user’s privacy settings, this may return an alternative value.

            • OptionalemailAddress?: string

              The email address of the user. Depending on the user’s privacy settings, this may be returned as null.

            • Optionalself?: string

              The URL of the user.

            • OptionaltimeZone?: string

              The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as null.

          • Optionalcomment?:
                | string
                | {
                    content: Record<string, any>[];
                    type: string & {} | "doc";
                    version: number;
                    [key: string]: unknown;
                }

            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.

          • Optionalcreated?: unknown

            The datetime on which the worklog was created.

          • Optionalid?: string

            The ID of the worklog record.

          • OptionalissueId?: string

            The ID of the issue this worklog is for.

          • Optionalproperties?: { key?: string; value?: unknown; [key: string]: unknown }[]

            Details of properties for the worklog. Optional when creating or updating a worklog.

          • Optionalself?: string

            The URL of the worklog item.

          • Optionalstarted?: unknown

            The datetime on which the worklog effort was started. Required when creating a worklog. Optional when updating a worklog.

          • OptionaltimeSpent?: string

            The 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.

          • OptionaltimeSpentSeconds?: number

            The 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.

          • OptionalupdateAuthor?: {
                accountId?: string;
                accountType?: string;
                active?: boolean;
                avatarUrls?: {
                    "16x16"?: string;
                    "24x24"?: string;
                    "32x32"?: string;
                    "48x48"?: string;
                    [key: string]: unknown;
                };
                displayName?: string;
                emailAddress?: string;
                self?: string;
                timeZone?: string;
                [key: string]: unknown;
            }
            • OptionalaccountId?: string

              The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, 5b10ac8d82e05b22cc7d4ef5.

            • OptionalaccountType?: string

              The 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)

            • Optionalactive?: boolean

              Whether the user is active.

            • OptionalavatarUrls?: {
                  "16x16"?: string;
                  "24x24"?: string;
                  "32x32"?: string;
                  "48x48"?: string;
                  [key: string]: unknown;
              }
              • Optional16x16?: string

                The URL of the item's 16x16 pixel avatar.

              • Optional24x24?: string

                The URL of the item's 24x24 pixel avatar.

              • Optional32x32?: string

                The URL of the item's 32x32 pixel avatar.

              • Optional48x48?: string

                The URL of the item's 48x48 pixel avatar.

            • OptionaldisplayName?: string

              The display name of the user. Depending on the user’s privacy settings, this may return an alternative value.

            • OptionalemailAddress?: string

              The email address of the user. Depending on the user’s privacy settings, this may be returned as null.

            • Optionalself?: string

              The URL of the user.

            • OptionaltimeZone?: string

              The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as null.

          • Optionalupdated?: unknown

            The datetime on which the worklog was last updated.

          • Optionalvisibility?: {
                identifier?: string | null;
                type?: "role" | "group" | string & {};
                value?: string;
                [key: string]: unknown;
            }
            • Optionalidentifier?: string | null

              The ID of the group or the name of the role that visibility of this item is restricted to.

            • Optionaltype?: "role" | "group" | string & {}

              Whether visibility of this item is restricted to a group or role.

            • Optionalvalue?: string

              The 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.

        • Optionalexpand?: string | string[] | string & {} | ("properties" | 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.

      • Optionaloptions: RequestOptions

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