Function: addWorklog()
function addWorklog(
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:70
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:
- Browse projects and Work on issues project permission for the project that the issue is in.
- If issue-level security is configured, issue-level security permission to view the issue.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | Client | - |
parameters | { adjustEstimate?: "auto" | "manual" | "new" | string & object | "leave"; 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; expand?: | "properties" | string & object | ("properties" | string & object)[]; id?: string; issueId?: string; issueIdOrKey: string; newEstimate?: string; notifyUsers?: boolean; overrideEditableFlag?: boolean; properties?: object[]; reduceBy?: string; 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.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. - manual Reduces the estimate by amount specified in reduceBy. - auto Reduces the estimate by the value of timeSpent in the worklog. |
parameters.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.author.accountId? | string | The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, 5b10ac8d82e05b22cc7d4ef5. |
parameters.author.accountType? | 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) |
parameters.author.active? | boolean | Whether the user is active. |
parameters.author.avatarUrls? | { 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; } | - |
parameters.author.avatarUrls.16x16? | string | The URL of the item's 16x16 pixel avatar. |
parameters.author.avatarUrls.24x24? | string | The URL of the item's 24x24 pixel avatar. |
parameters.author.avatarUrls.32x32? | string | The URL of the item's 32x32 pixel avatar. |
parameters.author.avatarUrls.48x48? | string | The URL of the item's 48x48 pixel avatar. |
parameters.author.displayName? | string | The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. |
parameters.author.emailAddress? | string | The email address of the user. Depending on the user’s privacy settings, this may be returned as null. |
parameters.author.self? | string | The URL of the user. |
parameters.author.timeZone? | string | The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as null. |
parameters.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.created? | unknown | The datetime on which the worklog was created. |
parameters.expand? | | "properties" | string & object | ("properties" | string & object)[] | Use expand to include additional information about work logs in the response. This parameter accepts properties, which returns worklog properties. |
parameters.id? | string | The ID of the worklog record. |
parameters.issueId? | string | The ID of the issue this worklog is for. |
parameters.issueIdOrKey? | string | The ID or key the issue. |
parameters.newEstimate? | 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. |
parameters.notifyUsers? | boolean | Whether users watching the issue are notified by email. |
parameters.overrideEditableFlag? | 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. |
parameters.properties? | object[] | Details of properties for the worklog. Optional when creating or updating a worklog. |
parameters.reduceBy? | 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. |
parameters.self? | string | The URL of the worklog item. |
parameters.started? | unknown | The datetime on which the worklog effort was started. Required when creating a worklog. Optional when updating a worklog. |
parameters.timeSpent? | 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. |
parameters.timeSpentSeconds? | 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. |
parameters.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.updateAuthor.accountId? | string | The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, 5b10ac8d82e05b22cc7d4ef5. |
parameters.updateAuthor.accountType? | 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) |
parameters.updateAuthor.active? | boolean | Whether the user is active. |
parameters.updateAuthor.avatarUrls? | { 16x16?: string; 24x24?: string; 32x32?: string; 48x48?: string; } | - |
parameters.updateAuthor.avatarUrls.16x16? | string | The URL of the item's 16x16 pixel avatar. |
parameters.updateAuthor.avatarUrls.24x24? | string | The URL of the item's 24x24 pixel avatar. |
parameters.updateAuthor.avatarUrls.32x32? | string | The URL of the item's 32x32 pixel avatar. |
parameters.updateAuthor.avatarUrls.48x48? | string | The URL of the item's 48x48 pixel avatar. |
parameters.updateAuthor.displayName? | string | The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. |
parameters.updateAuthor.emailAddress? | string | The email address of the user. Depending on the user’s privacy settings, this may be returned as null. |
parameters.updateAuthor.self? | string | The URL of the user. |
parameters.updateAuthor.timeZone? | string | The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as null. |
parameters.updated? | unknown | The datetime on which the worklog was last updated. |
parameters.visibility? | { identifier?: string | null; type?: "role" | "group" | string & object; value?: string; } | - |
parameters.visibility.identifier? | string | null | The ID of the group or the name of the role that visibility of this item is restricted to. |
parameters.visibility.type? | "role" | "group" | string & object | Whether visibility of this item is restricted to a group or role. |
parameters.visibility.value? | 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. |
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; }; }>