///
import { CacheManager } from '../cacheManager';
import { Issue } from '../types/issue';
import { IdProperty, AccountIdProperty, NameProperty, KeyProperty } from '../raw-api/common';
import { AtlassianDocumentFormat } from '@avst-lib/jira-cloud/types/adf';
export declare class IssueBuilder {
private cacheManager;
private fieldOperations;
constructor(cacheManager: CacheManager, fieldOperations?: FieldOperation[]);
clearCache(): IssueBuilder;
/**
* Sets the reporter.
* @param reporter Reporter's accountId or user object or email;
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withReporter(reporter: string | AccountIdProperty | null | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the project.
* @param project Project ID or key or project object;
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withProject(project: number | string | IdProperty | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the issue type.
* @param issueType Issue type ID or name or issue type object;
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withIssueType(issueType: number | string | IdProperty | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the parent issue for a sub-task.
* @param parentIssue Parent Issue key, Issue ID or Issue object;
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withParent(parentIssue: string | KeyProperty | IdProperty | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the components.
* @param components Array of component IDs or component object;
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withComponents(components: Array | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the assignee.
* @param assignee Assignee's accountId or user object or email;
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withAssignee(assignee: string | AccountIdProperty | null | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the fix versions.
* @param fixVersions Array of fix version IDs or version objects;
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withFixVersions(fixVersions: Array | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the priority.
* @param priority Priority ID, name or priority object;
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withPriority(priority: number | string | IdProperty | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the versions.
* @param versions Array of version IDs or version objects;
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withVersions(versions: Array | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the security.
* @param security Issue security level ID or security level object;
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withSecurity(security: number | string | IdProperty | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the labels.
* @param labels Array of labels;
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withLabels(labels: string[] | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the due date.
* @param dueDate Due date for the issue either as a ISO 8601 string or date object;
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withDueDate(dueDate: string | Date | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the description.
* @param description Issue description as a string or content object;
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withDescription(description: string | AtlassianDocumentFormat | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the environment.
* @param environment Issue environment as a string or content object;
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withEnvironment(environment: string | AtlassianDocumentFormat | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the resolution while updating an issue.
* @param resolution Issue resolution ID, name or resolution object;
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withResolution(resolution: number | string | IdProperty | undefined, updateOperation?: UpdateOperation): IssueBuilder;
withSummary(summary: string | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withTextCustomField(customField: string | undefined, value: string | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withReadOnlyTextCustomField(customField: string | undefined, value: string | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value: literal color.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withIssueColorCustomField(customField: string | undefined, value: string | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value: uuid.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withUUIDCustomField(customField: string | undefined, value: string | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value for issues with epic issue type.
* ghx-label-1 - brown
* ghx-label-2 - yellow
* ghx-label-3 - light brown
* ghx-label-4 - dark blue
* ghx-label-5 - light blue
* ghx-label-6 - light green
* ghx-label-7 - coral/orange
* ghx-label-8 - dark purple
* ghx-label-9 - light pink
* ghx-label-10 - lavender
* ghx-label-11 - light aqua
* ghx-label-12- light gray
* ghx-label-13 - dark green
* ghx-label-14 - dark coral/red(ish)
* @param customField Custom field ID or name.
* @param value Custom field value: epic color.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withEpicColorCustomField(customField: string | undefined, value: string | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value for issues with epic issue type.
* @param customField Custom field ID or name.
* @param value Custom field value, either ID or status object.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withEpicStatusCustomField(customField: string | undefined, value: string | number | IdProperty | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value: epic issue key.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withEpicLinkCustomField(customField: string | undefined, value: string | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value for issues with epic issue type.
* @param customField Custom field ID or name.
* @param value Custom field value: name.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withEpicNameCustomField(customField: string | undefined, value: string | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withNumberCustomField(customField: string | undefined, value: number | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value, either option of project's key or ID.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withProjectPickerCustomField(customField: string | undefined, value: string | number | IdProperty | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value, an array of either option name or ID.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withMultiSelectCustomField(customField: string | undefined, value: Array | null | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value, either ISO 8601 string or Date object.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withDatePickerCustomField(customField: string | undefined, value: Date | string | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value, either option name or ID.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withSelectCustomField(customField: string | undefined, value: string | number | IdProperty | null | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value, an array of either option name or ID.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withMultiCheckBoxesCustomField(customField: string | undefined, value: Array | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value, either ISO 8601 string or Date object.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withDateTimePickerCustomField(customField: string | undefined, value: Date | string | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value, an array of labels.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withLabelsCustomField(customField: string | undefined, value: string[] | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value, either option name or ID.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withRadioButtonsCustomField(customField: string | undefined, value: string | number | IdProperty | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value, either Content object or string.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withMultiLineTextCustomField(customField: string | undefined, value: AtlassianDocumentFormat | string | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value, either string or URL object.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withURLCustomField(customField: string | undefined, value: URL | string | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value: User's account ID or email.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withUserPickerCustomField(customField: string | undefined, value: AccountIdProperty | string | null | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value, an array of group names.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withMultiGroupPickerCustomField(customField: string | undefined, value: Array | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value: Group's name.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withGroupPickerCustomField(customField: string | undefined, value: string | NameProperty | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value, an array of User's object, accound ID or email.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withMultiUserPickerCustomField(customField: string | undefined, value: Array | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value, an array of either option key or ID.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withMultiVersionPickerCustomField(customField: string | undefined, value: Array | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value, either option key or ID.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
withVersionPickerCustomField(customField: string | undefined, value: string | number | IdProperty | undefined, updateOperation?: UpdateOperation): IssueBuilder;
/**
* Sets the custom field value.
* @param customField Custom field ID or name.
* @param value Custom field value, list of options, either option IDs or option names.
* @param updateOperation You can optionally specify update operation if you wish to send the value under 'update' property, if it is not specified the value will be sent under 'fields' property.
*/
buildCreateRequest(): Promise>;
buildUpdateRequest(): Promise>;
private build;
private processField;
private populateFieldId;
private processValues;
private processProjectValue;
private processIssueType;
private waitForProjectToBeResolved;
private processParentIssue;
private processUserPickerSystemField;
private processMultiIDField;
private processPriority;
private processResolution;
private processSecurity;
private processMultiOptionField;
private processSingleOptionField;
private processDateField;
private processTextAreaField;
private processUserPickerField;
private processGroupPickerField;
private processMultiGroupPickerField;
private processURLField;
private processProjectPickerField;
private processFieldWithID;
private processMultiVersionPickerField;
private processMultiUserPickerField;
private getAccountIdByEmail;
private setSystemField;
private setCustomField;
private getNewInstance;
}
export interface FieldOperation {
id?: string;
name: string;
value: any;
updateOperation?: UpdateOperation;
isErrorInProcessProjectValue?: boolean;
}
export declare type UpdateOperation = 'add' | 'set' | 'remove' | 'edit';
//# sourceMappingURL=issue.d.ts.map