diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/AzureDevOps.py b/Packs/AzureDevOps/Integrations/AzureDevOps/AzureDevOps.py index 8b94684a6e98..3bd28f46ab1f 100644 --- a/Packs/AzureDevOps/Integrations/AzureDevOps/AzureDevOps.py +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/AzureDevOps.py @@ -1,12 +1,26 @@ +import json +from pathlib import Path + import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 # type: ignore from MicrosoftApiModule import * # noqa: E402 import copy from requests import Response +from typing import NamedTuple from collections.abc import Callable +from datetime import datetime import urllib3 +MISSING_PARAMETERS_ERROR_MSG = "One or more arguments are missing." \ + "Please pass with the command: {arguments}" \ + "You can also re-configure the instance and set them as parameters." + +MISSING_PARAMETERS_ERROR_MSG_2 = "One or more arguments are missing." \ + "Please pass with the command: repository and project." \ + "You can also re-configure the instance and set them as parameters." + +COMMIT_HEADERS_MAPPING = {'commitId': 'Commit ID', 'committer': 'Committer', 'comment': 'Comment'} INCIDENT_TYPE_NAME = "Azure DevOps" OUTGOING_MIRRORED_FIELDS = {'status': 'The status of the pull request.', 'title': 'The title of the pull request.', @@ -17,6 +31,25 @@ GRANT_BY_CONNECTION = {'Device Code': DEVICE_CODE, 'Authorization Code': AUTHORIZATION_CODE} AZURE_DEVOPS_SCOPE = "499b84ac-1321-427f-aa17-267ca6975798/user_impersonation offline_access" +DATE_FORMAT = '%Y-%m-%dT%H:%M:%S.%fZ' # ISO8601 format with UTC, default in XSOAR + + +class Project(NamedTuple): + organization: str + repository: str + project: str + + @property + def repo_url(self) -> str: + return f'https://dev.azure.com/{self.organization}/{self.project}/_apis/git/repositories/{self.repository}' + + @property + def project_url(self) -> str: + return f'https://dev.azure.com/{self.organization}/{self.project}' + + @property + def organization_url(self) -> str: + return f'https://dev.azure.com/{self.organization}' class Client: @@ -233,12 +266,13 @@ def pull_requests_get_request(self, project: str, repository_id: str, pull_reque return response - def pull_requests_list_request(self, project: str, repository: str, skip: int = None, limit: int = None) -> dict: + def pull_requests_list_request(self, project: str | None, repository: str | None, skip: int = None, + limit: int = None) -> dict: """ Retrieve pull requests in repository. Args: - project (str): The name or the ID of the project. - repository (str): The repository name of the pull request's target branch. + project (str | None): The name or the ID of the project. + repository (str | None): The repository name of the pull request's target branch. skip (int): The number of results to skip. limit (int): The number of results to retrieve. @@ -399,13 +433,13 @@ def pipeline_list_request(self, project: str, limit: int = None, return response - def branch_list_request(self, project: str, repository: str, limit: int = None, + def branch_list_request(self, project: str | None, repository: str | None, limit: int = None, continuation_token: str = None) -> Response: """ Retrieve repository branches list. Args: - project (str): The name of the project. - repository (str): The name of the project repository. + project (str | None): The name of the project. + repository (str | None): The name of the project repository. limit (int): The number of results to retrieve. continuation_token (str): A continuation token from a previous request, to retrieve the next page of results. @@ -427,6 +461,252 @@ def branch_list_request(self, project: str, repository: str, limit: int = None, return response + def list_pull_requests_reviewers(self, project_args: Project, pull_request_id: Optional[int]): + + params = {"api-version": 7.0} + full_url = f'{project_args.repo_url}/pullRequests/{pull_request_id}/reviewers' + + return self.ms_client.http_request(method='GET', + full_url=full_url, + params=params, + resp_type='json') + + def add_pull_requests_reviewer(self, project_args: Project, pull_request_id: Optional[int], + reviewer_user_id: str, is_required: bool): + params = {"api-version": 7.0} + data = {"id": reviewer_user_id, "isRequired": is_required, "vote": 0} + + full_url = f'{project_args.repo_url}/pullRequests/{pull_request_id}/reviewers/{reviewer_user_id}' + + return self.ms_client.http_request(method='PUT', + full_url=full_url, + json_data=data, + params=params, + resp_type='json') + + def list_pull_requests_commits(self, project_args: Project, pull_request_id: Optional[int], limit: int): + + params = {"api-version": 7.0, "$top": limit} + full_url = f'{project_args.repo_url}/pullRequests/{pull_request_id}/commits' + + return self.ms_client.http_request(method='GET', + full_url=full_url, + params=params, + resp_type='json') + + def list_commits(self, project_args: Project, limit: int, offset: int): + + params = {"api-version": 7.0, "searchCriteria.$skip": offset, "searchCriteria.$top": limit} + full_url = f'{project_args.repo_url}/commits' + + return self.ms_client.http_request(method='GET', + full_url=full_url, + params=params, + resp_type='json') + + def get_commit(self, project_args: Project, commit_id: str): + + params = {"api-version": 7.0} + full_url = f'{project_args.repo_url}/commits/{commit_id}' + + return self.ms_client.http_request(method='GET', + full_url=full_url, + params=params, + resp_type='json') + + def get_work_item(self, project_args: Project, item_id: str): + + params = {"api-version": 7.0} + full_url = f'{project_args.project_url}/_apis/wit/workitems/{item_id}' + + return self.ms_client.http_request(method='GET', + full_url=full_url, + params=params, + resp_type='json') + + def create_work_item(self, project_args: Project, args: Dict[str, Any]): + arguments_list = ['title', 'iteration_path', 'description', 'priority', 'tag'] + + data = work_item_pre_process_data(args, arguments_list) + + params = {"api-version": 7.0} + + full_url = f'{project_args.project_url}/_apis/wit/workitems/${args["type"]}' + + return self.ms_client.http_request(method='POST', + headers={"Content-Type": "application/json-patch+json"}, + full_url=full_url, + params=params, + json_data=data, + resp_type='json') + + def update_work_item(self, project_args: Project, args: Dict[str, Any]): + arguments = ['title', 'assignee_display_name', 'state', 'iteration_path', 'description', 'priority', 'tag'] + + data = work_item_pre_process_data(args, arguments) + + params = {"api-version": 7.0} + + full_url = f'{project_args.project_url}/_apis/wit/workitems/{args["item_id"]}' + + return self.ms_client.http_request(method='PATCH', + headers={"Content-Type": "application/json-patch+json"}, + full_url=full_url, + params=params, + json_data=data, + resp_type='json') + + def file_request(self, project_args: Project, change_type: str, args: Dict[str, Any]): + + data = file_pre_process_body_request(change_type, args) + + params = {"api-version": 7.0} + + full_url = f'{project_args.repo_url}/pushes' + + return self.ms_client.http_request(method='POST', + full_url=full_url, + params=params, + json_data=data, + resp_type='json') + + def list_files(self, project_args: Project, args: Dict[str, Any]): + + params = {"api-version": 7.0, "versionDescriptor.version": args["branch_name"].split('/')[-1], + "versionDescriptor.versionType": "branch", "recursionLevel": args["recursion_level"], + "includeContentMetadata": True} + + full_url = f'{project_args.repo_url}/items' + + return self.ms_client.http_request(method='GET', + full_url=full_url, + params=params, + resp_type='json') + + def get_file(self, project_args: Project, args: Dict[str, Any]): + + params = {"path": args["file_name"], "api-version": 7.0, "$format": args["format"], + "includeContent": args["include_content"], "versionDescriptor.versionType": "branch", + "versionDescriptor.version": args["branch_name"].split("/")[-1]} + + full_url = f'{project_args.repo_url}/items' + + headers = {"Content-Type": "application/json" if args["format"] == 'json' else "application/zip"} + + return self.ms_client.http_request(method='GET', + full_url=full_url, + headers=headers, + params=params, + resp_type='response' if args["format"] == 'zip' else 'json') + + def create_branch(self, project_args: Project, args: Dict[str, Any]): + + # initialize new branch - this is the syntax if no reference was given + args["branch_id"] = args.get("branch_id") or "0000000000000000000000000000000000000000" + + data = file_pre_process_body_request("add", args) + params = {"api-version": 7.0} + + full_url = f'{project_args.repo_url}/pushes' + + return self.ms_client.http_request(method='POST', + full_url=full_url, + params=params, + json_data=data, + resp_type='json') + + def create_pull_request_thread(self, project_args: Project, args: Dict[str, Any]): + + data = { + "comments": [ + { + "parentCommentId": 0, + "content": args["comment_text"], + "commentType": 1 + } + ], + "status": 1 + } + + params = {"api-version": 7.0} + + full_url = f'{project_args.repo_url}/pullRequests/{args["pull_request_id"]}/threads' + + return self.ms_client.http_request(method='POST', + full_url=full_url, + params=params, + json_data=data, + resp_type='json') + + def update_pull_request_thread(self, project_args: Project, args: Dict[str, Any]): + + data = { + "comments": [ + { + "parentCommentId": 0, + "content": args["comment_text"], + "commentType": 1 + } + ], + "status": 1 + } + + params = {"api-version": 7.0} + + full_url = f'{project_args.repo_url}/pullRequests/{args["pull_request_id"]}/threads/{args["thread_id"]}' + + return self.ms_client.http_request(method='PATCH', + full_url=full_url, + params=params, + json_data=data, + resp_type='json') + + def list_pull_request_threads(self, project_args: Project, pull_request_id: str): + + params = {"api-version": 7.0} + + full_url = f'{project_args.repo_url}/pullRequests/{pull_request_id}/threads' + + return self.ms_client.http_request(method='GET', + full_url=full_url, + params=params, + resp_type='json') + + def list_project_teams(self, project_args: Project): + + params = {"api-version": 7.0} + + full_url = f'https://dev.azure.com/{project_args.organization}/_apis/projects/' \ + f'{project_args.project}/teams' + + return self.ms_client.http_request(method='GET', + full_url=full_url, + params=params, + resp_type='json') + + def list_team_members(self, project_args: Project, args: Dict[str, Any], limit: int, skip: int): + + params = {"api-version": 7.0, "$skip": skip, "$top": limit} + + full_url = f'https://dev.azure.com/{project_args.organization}/_apis/projects/' \ + f'{project_args.project}/teams/{args["team_id"]}/members' + + return self.ms_client.http_request(method='GET', + full_url=full_url, + params=params, + resp_type='json') + + def get_blob_zip(self, project_args: Project, file_object_id: str): + + params = {"api-version": 7.0, "$format": "zip"} + + full_url = f'{project_args.repo_url}/blobs/{file_object_id}' + + return self.ms_client.http_request(method='GET', + full_url=full_url, + params=params, + resp_type='response') + def generate_pipeline_run_output(response: dict, project: str) -> dict: """ @@ -688,26 +968,29 @@ def generate_pull_request_readable_information(response: Union[dict, list], return readable_output -def pull_request_create_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def pull_request_create_command(client: Client, args: Dict[str, Any], repository: Optional[str], project: Optional[str])\ + -> CommandResults: """ Create a new pull-request. Args: client (Client): Azure DevOps API client. args (dict): Command arguments from XSOAR. + repository: Azure DevOps repository. + project: Azure DevOps project. Returns: CommandResults: outputs, readable outputs and raw response for XSOAR. """ - project = args['project'] - repository_id = args['repository_id'] + project_args = organization_repository_project_preprocess(args=args, organization=None, repository_id=repository, + project=project, is_organization_required=False) + project, repository_id = project_args.project, project_args.repository + source_branch = args['source_branch'] target_branch = args['target_branch'] title = args['title'] description = args['description'] - - reviewers_ids = argToList(args['reviewers_ids']) - + reviewers_ids = argToList(args.get('reviewers_ids')) reviewers = [{"id": reviewer} for reviewer in reviewers_ids] source_branch = source_branch if source_branch.startswith('refs/') else f'refs/heads/{source_branch}' @@ -732,10 +1015,13 @@ def pull_request_create_command(client: Client, args: Dict[str, Any]) -> Command return command_results -def pull_request_update_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def pull_request_update_command(client: Client, args: Dict[str, Any], repository: Optional[str], project: Optional[str])\ + -> CommandResults: """ Update a pull request. Args: + project: Azure DevOps project. + repository: Azure DevOps repository. client (Client): Azure DevOps API client. args (dict): Command arguments from XSOAR. @@ -743,8 +1029,10 @@ def pull_request_update_command(client: Client, args: Dict[str, Any]) -> Command CommandResults: outputs, readable outputs and raw response for XSOAR. """ - project = args['project'] - repository_id = args['repository_id'] + project_args = organization_repository_project_preprocess(args=args, repository_id=repository, project=project, + is_organization_required=False, organization=None) + project, repository = project_args.project, project_args.repository + pull_request_id = args['pull_request_id'] title = args.get('title') description = args.get('description') @@ -755,11 +1043,11 @@ def pull_request_update_command(client: Client, args: Dict[str, Any]) -> Command last_merge_source_commit = None if status == "completed": - pr_data = client.pull_requests_get_request(project, repository_id, pull_request_id) + pr_data = client.pull_requests_get_request(project, repository, pull_request_id) last_merge_source_commit = pr_data.get("lastMergeSourceCommit") response = client.pull_request_update_request( - project, repository_id, pull_request_id, title, description, status, last_merge_source_commit) + project, repository, pull_request_id, title, description, status, last_merge_source_commit) outputs = copy.deepcopy(response) created_date = arg_to_datetime(response.get('creationDate')) @@ -810,10 +1098,18 @@ def pull_request_get_command(client: Client, args: Dict[str, Any]) -> CommandRes return command_results -def pull_requests_list_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def verify_repository_and_project_argument(repository: Optional[str], project: Optional[str]): + if not (repository and project): + raise DemistoException(MISSING_PARAMETERS_ERROR_MSG_2) + + +def pull_requests_list_command(client: Client, args: Dict[str, Any], repository: Optional[str], project: Optional[str])\ + -> CommandResults: """ Retrieve pull requests in repository. Args: + project: Azure DevOps project. + repository: Azure DevOps repository. client (Client): Azure DevOps API client. args (dict): Command arguments from XSOAR. @@ -821,8 +1117,10 @@ def pull_requests_list_command(client: Client, args: Dict[str, Any]) -> CommandR CommandResults: outputs, readable outputs and raw response for XSOAR. """ - project = args['project'] - repository = args['repository'] + project = args.get('project') or project + repository = args.get('repository') or repository + verify_repository_and_project_argument(repository, project) + page = arg_to_number(args.get('page')) or 1 limit = arg_to_number(args.get('limit')) or 50 @@ -1184,19 +1482,23 @@ def pipeline_list_command(client: Client, args: Dict[str, Any]) -> CommandResult ) -def branch_list_command(client: Client, args: Dict[str, Any]) -> CommandResults: +def branch_list_command(client: Client, args: Dict[str, Any], repository: Optional[str], project: Optional[str])\ + -> CommandResults: """ Retrieve repository branches list. Args: client (Client): Azure DevOps API client. args (dict): Command arguments from XSOAR. + repository: Azure DevOps repository. + project: Azure DevOps project. Returns: CommandResults: outputs, readable outputs and raw response for XSOAR. """ - project = args['project'] - repository = args['repository'] + project = args.get('project') or project + repository = args.get('repository') or repository + verify_repository_and_project_argument(repository, project) page = arg_to_number(args.get('page')) or 1 limit = arg_to_number(args.get('limit')) or 50 @@ -1230,7 +1532,7 @@ def branch_list_command(client: Client, args: Dict[str, Any]) -> CommandResults: readable_output = tableToMarkdown( readable_message, outputs, - headers=['name'], + headers=['name', 'objectId'], headerTransform=string_to_table_header ) @@ -1262,7 +1564,7 @@ def get_update_args(delta: dict, data: dict) -> dict: return arguments -def update_remote_system_command(client: Client, args: Dict[str, Any]) -> str: +def update_remote_system_command(client: Client, args: Dict[str, Any], repository: Optional[str], project: Optional[str]) -> str: """ Pushes local changes to the remote system Args: @@ -1272,6 +1574,8 @@ def update_remote_system_command(client: Client, args: Dict[str, Any]) -> str: args['entries']: the entries to send to the remote system args['incident_changed']: boolean telling us if the local incident indeed changed or not args['remote_incident_id']: the remote incident id + repository: The Azure DevOps repository name. + project: The Azure DevOps project name. Returns: str: The new ID of the updated incident. @@ -1289,7 +1593,7 @@ def update_remote_system_command(client: Client, args: Dict[str, Any]) -> str: if remote_args.incident_changed: update_args = get_update_args(remote_args.delta, remote_args.data) demisto.debug(f'Sending incident with remote ID [{remote_args.remote_incident_id}] to Azure DevOps\n') - pull_request_update_command(client, update_args) + pull_request_update_command(client, update_args, repository=repository, project=project) else: demisto.debug(f'Skipping updating remote incident fields [{remote_args.remote_incident_id}] ' @@ -1515,6 +1819,627 @@ def is_new_pr(project: str, repository: str, client: Client, last_id: int) -> bo return True +def file_pre_process_body_request(change_type: str, args: Dict[str, Any]) -> dict: + # pre-process branch + branch_name = args["branch_name"] + branch_id = args["branch_id"] + branch_details = [{"name": branch_name, "oldObjectId": branch_id}] + + # pre-process commit + comment = args["commit_comment"] + file_path = args.get("file_path", "") + file_content = args.get("file_content", "") + + # validate file_path exists (explicitly or entry_id), file_content can be empty + entry_id = args.get("entry_id", "") + if not (entry_id or file_path): + raise DemistoException('specify either the "file_path" or the "entry_id" of the file.') + + # Take the given arguments, not the entry id, if file_path and entry_id are passed. Otherwise, take the entry id. + if not file_path: + file_path = demisto.getFilePath(entry_id)["path"] + file_content = Path(file_path).read_text() + + changes = {"changeType": change_type, "item": {"path": file_path}} + + # in case of add/edit (create/update), add another key with the new content + if change_type != "delete": + changes["newContent"] = {"content": file_content, "contentType": "rawtext"} + + commits = [{"comment": comment, "changes": [changes]}] + + data = {"refUpdates": branch_details, "commits": commits} + + return data + + +def pagination_preprocess_and_validation(args: Dict[str, Any]) -> tuple[int, int]: + """ + Ensure the pagination values are valid. + """ + limit = arg_to_number(args.get('limit')) or 50 + page = arg_to_number(args.get('page')) or 1 + + if page < 1 or limit < 1: + raise ValueError('Page and limit arguments must be at least 1.') + + return limit, (page - 1) * limit + + +def organization_repository_project_preprocess(args: Dict[str, Any], organization: Optional[str], repository_id: Optional[str], + project: Optional[str], is_repository_id_required: bool = True, + is_organization_required: bool = True) -> Project: + """ + The organization, repository and project are preprocessed by this function. + """ + + # Those arguments are already set as parameters, but the user can override them. + organization = args.get('organization_name') or organization + repository_id = args.get('repository_id') or repository_id + project = args.get('project_name') or project + missing_arguments = [] + + # validate those arguments exist + if is_organization_required and not organization: + missing_arguments.append("organization name") + + if is_repository_id_required and not repository_id: + missing_arguments.append("repository_id / repository") + + if not project: + missing_arguments.append("project") + + if missing_arguments: + raise DemistoException(MISSING_PARAMETERS_ERROR_MSG.format(arguments=", ".join(missing_arguments))) + + # Validation in organization, project and repository ensures the right type is passed + return Project(organization=organization, repository=repository_id, project=project) # type:ignore[arg-type] + + +def pull_request_reviewer_list_command(client: Client, args: Dict[str, Any], organization: Optional[str], + repository_id: Optional[str], project: Optional[str]) -> CommandResults: + """ + Retrieve the reviewers for a pull request. + """ + + # pre-processing inputs + project_args = organization_repository_project_preprocess(args, organization, repository_id, project) + + pull_request_id = arg_to_number(args.get('pull_request_id')) + + response = client.list_pull_requests_reviewers(project_args, pull_request_id) + mapping = {"displayName": "Reviewer(s)", "hasDeclined": "Has Declined", "isFlagged": "Is Flagged"} + readable_output = tableToMarkdown('Reviewers List', response["value"], headers=["displayName", "hasDeclined", "isFlagged"], + headerTransform=lambda header: mapping.get(header, header)) + + return CommandResults( + readable_output=readable_output, + outputs_prefix='AzureDevOps.PullRequestReviewer', + outputs_key_field='displayName', + outputs=response["value"], + raw_response=response + ) + + +def pull_request_reviewer_add_command(client: Client, args: Dict[str, Any], organization: Optional[str], + repository_id: Optional[str], project: Optional[str]) -> CommandResults: + """ + Add a reviewer to a pull request. + """ + + # pre-processing inputs + project_args = organization_repository_project_preprocess(args, organization, repository_id, project) + pull_request_id = arg_to_number(args.get('pull_request_id')) + + reviewer_user_id = args["reviewer_user_id"] # reviewer_user_id is required + is_required = args.get('is_required', False) + + response = client.add_pull_requests_reviewer(project_args, pull_request_id, reviewer_user_id, is_required) + + readable_output = f'{response.get("displayName", "")} ({response.get("id", "")}) was created successfully as a reviewer for' \ + f' Pull Request ID {pull_request_id}.' + + return CommandResults( + readable_output=readable_output, + outputs_prefix='AzureDevOps.PullRequestReviewer', + outputs=response, + raw_response=response + ) + + +def pull_request_commit_list_command(client: Client, args: Dict[str, Any], organization: Optional[str], + repository_id: Optional[str], project: Optional[str]) -> CommandResults: + """ + Get the commits for the specified pull request. + """ + # pre-processing inputs + project_args = organization_repository_project_preprocess(args, organization, repository_id, project) + pull_request_id = arg_to_number(args.get('pull_request_id')) + + # pagination + limit, offset = pagination_preprocess_and_validation(args) + + response = client.list_pull_requests_commits(project_args, pull_request_id, limit) + + readable_output = tableToMarkdown('Commits', response.get('value'), headers=['comment', 'commitId', 'committer'], + headerTransform=lambda header: COMMIT_HEADERS_MAPPING.get(header, header)) + + return CommandResults( + readable_output=readable_output, + outputs_prefix='AzureDevOps.Commit', + outputs=response.get('value'), + raw_response=response + ) + + +def commit_list_command(client: Client, args: Dict[str, Any], organization: Optional[str], repository_id: Optional[str], + project: Optional[str]) -> CommandResults: + """ + Get the commits for the specified pull request. + """ + # pre-processing inputs + project_args = organization_repository_project_preprocess(args, organization, repository_id, project) + # pagination + limit, offset = pagination_preprocess_and_validation(args) + + response = client.list_commits(project_args, limit, offset) + + readable_output = tableToMarkdown('Commits', response.get('value'), headers=['comment', 'commitId', 'committer'], + headerTransform=lambda header: COMMIT_HEADERS_MAPPING.get(header, header)) + + return CommandResults( + readable_output=readable_output, + outputs_prefix='AzureDevOps.Commit', + outputs=response.get('value'), + raw_response=response + ) + + +def commit_get_command(client: Client, args: Dict[str, Any], organization: Optional[str], repository_id: Optional[str], + project: Optional[str]) -> CommandResults: + """ + Retrieve a particular commit. + """ + # pre-processing inputs + project_args = organization_repository_project_preprocess(args, organization, repository_id, project) + + commit_id = args["commit_id"] + + response = client.get_commit(project_args, commit_id) + + readable_output = tableToMarkdown('Commit Details', response, headers=['comment', 'commitId', 'committer'], + headerTransform=lambda header: COMMIT_HEADERS_MAPPING.get(header, header)) + + return CommandResults( + readable_output=readable_output, + outputs_prefix='AzureDevOps.Commit', + outputs=response, + raw_response=response + ) + + +def work_item_get_command(client: Client, args: Dict[str, Any], organization: Optional[str], repository_id: Optional[str], + project: Optional[str]) -> CommandResults: + """ + Returns a single work item. + """ + # pre-processing inputs + project_args = organization_repository_project_preprocess(args, organization, repository_id, project) + + item_id = args["item_id"] + + response = client.get_work_item(project_args, item_id) + + response_for_hr = {"ID": response.get("id"), + "Title": response.get("fields", {}).get("System.Title"), + "Assigned To": response.get("fields", {}).get("System.AssignedTo", {}).get("displayName"), + "State": response.get("fields", {}).get("System.State"), + "Area Path": response.get("fields", {}).get("System.AreaPath"), + "Tags": response.get("fields", {}).get("System.Tags"), + "Activity Date": response.get("fields", {}).get("System.ChangedDate")} + + readable_output = tableToMarkdown('Work Item Details', response_for_hr) + + return CommandResults( + readable_output=readable_output, + outputs_prefix='AzureDevOps.WorkItem', + outputs=response, + raw_response=response + ) + + +def work_item_pre_process_data(args: Dict[str, Any], arguments_list: List[str]) -> List[dict]: + """ + This function pre-processes the data before sending it to the body. + """ + mapping = {"title": "System.Title", + "iteration_path": "System.IterationPath", + "description": "System.Description", + "priority": "Microsoft.VSTS.Common.Priority", + "tag": "System.Tags", + "assignee_display_name": "System.AssignedTo", + "state": "System.State"} + + data: List[dict] = [] + + data.extend( + { + "op": "add", + "path": f'/fields/{mapping[argument]}', + "from": None, + "value": f'{args.get(argument)}', + } + for argument in arguments_list + if args.get(argument) + ) + return data + + +def work_item_create_command(client: Client, args: Dict[str, Any], organization: Optional[str], repository_id: Optional[str], + project: Optional[str]) -> CommandResults: + """ + Creates a single work item. + """ + # pre-processing inputs + project_args = organization_repository_project_preprocess(args, organization, repository_id, project) + + response = client.create_work_item(project_args, args) + + readable_output = f'Work Item {response["id"]} was created successfully.' + + return CommandResults( + readable_output=readable_output, + outputs_prefix='AzureDevOps.WorkItem', + outputs=response, + raw_response=response + ) + + +def work_item_update_command(client: Client, args: Dict[str, Any], organization: Optional[str], repository_id: Optional[str], + project: Optional[str]) -> CommandResults: + """ + Updates a single work item. + """ + # pre-processing inputs + project_args = organization_repository_project_preprocess(args, organization, repository_id, project) + + response = client.update_work_item(project_args, args) + + readable_output = f'Work Item {response.get("id")} was updated successfully.' + + return CommandResults( + readable_output=readable_output, + outputs_prefix='AzureDevOps.WorkItem', + outputs=response, + raw_response=response + ) + + +def extract_branch_id_and_validate_for_files_commands(client: Client, args: Dict[str, Any], project_args: Project): + """ + Extract the branch id by the given branch name. In case of None, raise an exception since branch does not exist. + """ + if branch_id := mapping_branch_name_to_branch_id(client, args, project_args): + return branch_id + raise DemistoException(f'The given branch {args["branch_name"]} does not exist.') + + +def file_create_command(client: Client, args: Dict[str, Any], organization: Optional[str], repository_id: Optional[str], + project: Optional[str]) -> CommandResults: + """ + Add a file to the repository. + """ + # pre-processing inputs + project_args = organization_repository_project_preprocess(args, organization, repository_id, project) + args["branch_id"] = extract_branch_id_and_validate_for_files_commands(client, args, project_args) + + response = client.file_request(project_args, change_type="add", args=args) + + readable_output = f'Commit "{response["commits"][0].get("comment")}" was created and pushed successfully by ' \ + f'"{response.get("pushedBy", {}).get("displayName")}" to branch "{args.get("branch_name")}".' + + return CommandResults( + readable_output=readable_output, + outputs_prefix='AzureDevOps.File', + outputs=response, + raw_response=response + ) + + +def file_update_command(client: Client, args: Dict[str, Any], organization: Optional[str], repository_id: Optional[str], + project: Optional[str]) -> CommandResults: + """ + Update a file in the repository. + """ + # pre-processing inputs + project_args = organization_repository_project_preprocess(args, organization, repository_id, project) + args["branch_id"] = extract_branch_id_and_validate_for_files_commands(client, args, project_args) + + response = client.file_request(project_args, change_type="edit", args=args) + + readable_output = f'Commit "{response.get("commits", [])[0].get("comment")}" was updated successfully by ' \ + f'"{response.get("pushedBy", {}).get("displayName")}" in branch "{args.get("branch_name")}".' + + return CommandResults( + readable_output=readable_output, + outputs_prefix='AzureDevOps.File', + outputs=response, + raw_response=response + ) + + +def file_delete_command(client: Client, args: Dict[str, Any], organization: Optional[str], repository_id: Optional[str], + project: Optional[str]) -> CommandResults: + """ + Delete a file in the repository. + """ + # pre-processing inputs + project_args = organization_repository_project_preprocess(args, organization, repository_id, project) + args["branch_id"] = extract_branch_id_and_validate_for_files_commands(client, args, project_args) + + response = client.file_request(project_args, change_type="delete", args=args) + + readable_output = f'Commit "{response.get("commits", [])[0].get("comment")}" was deleted successfully by ' \ + f'"{response.get("pushedBy", {}).get("displayName")}" in branch "{args.get("branch_name")}".' + + return CommandResults( + readable_output=readable_output, + outputs_prefix='AzureDevOps.File', + outputs=response, + raw_response=response + ) + + +def file_list_command(client: Client, args: Dict[str, Any], organization: Optional[str], repository_id: Optional[str], + project: Optional[str]) -> CommandResults: + """ + Retrieve repository files (items) list. + """ + # pre-processing inputs + project_args = organization_repository_project_preprocess(args, organization, repository_id, project) + + response = client.list_files(project_args, args=args) + + mapping = {"path": "File Name(s)", "objectId": "Object ID", "commitId": "Commit ID", "gitObjectType": "Object Type", + "isFolder": "Is Folder"} + readable_output = tableToMarkdown('Files', response.get("value"), headers=["path", "objectId", "commitId", "gitObjectType", + "isFolder"], + headerTransform=lambda header: mapping.get(header, header)) + + return CommandResults( + readable_output=readable_output, + outputs_prefix='AzureDevOps.File', + outputs=response.get("value"), + raw_response=response + ) + + +def file_get_command(client: Client, args: Dict[str, Any], organization: Optional[str], repository_id: Optional[str], + project: Optional[str]) -> list: + """ + Getting the file. + """ + # pre-processing inputs + project_args = organization_repository_project_preprocess(args, organization, repository_id, project) + + response = client.get_file(project_args, args=args) + file_name = Path(args["file_name"]).name + + if args["format"] == 'json': + mapping = {"path": "File Name(s)", "objectId": "Object ID", "commitId": "Commit ID"} + readable_output = tableToMarkdown('Files', response, headers=["path", "objectId", "commitId"], + headerTransform=lambda header: mapping.get(header, header)) + command_results = CommandResults( + readable_output=readable_output, + outputs_prefix='AzureDevOps.File', + outputs=response, + raw_response=response + ) + return [command_results, fileResult(filename=file_name, data=response["content"], file_type=EntryType.ENTRY_INFO_FILE)] + + # in case args["format"] == 'zip' + return [fileResult(filename=file_name, data=response.content, file_type=EntryType.FILE)] + + +def mapping_branch_name_to_branch_id(client: Client, args: Dict[str, Any], project_args: Project): + """ + This function converts a branch name to branch id. If the given branch does not exist, returns None. + """ + branch_list = branch_list_command(client, args, project_args.repository, project_args.project) + for branch in branch_list.outputs: # type: ignore[union-attr, attr-defined] + # two places call this function, one has target_ref as an argument, the other has branch_name + if branch.get("name").endswith(args.get("target_ref", args.get("branch_name"))): + return branch.get("objectId") + return None + + +def branch_create_command(client: Client, args: Dict[str, Any], organization: Optional[str], repository_id: Optional[str], + project: Optional[str]) -> CommandResults: + """ + Create a branch. + """ + # pre-processing inputs + project_args = organization_repository_project_preprocess(args, organization, repository_id, project) + # convert target_ref to branch id + if args.get("target_ref"): + args["branch_id"] = mapping_branch_name_to_branch_id(client, args, project_args) + + response = client.create_branch(project_args, args=args) + + # For deleting this redundant file, we re-set the reference to be itself in case the new branch came from a reference branch. + if args.get("target_ref"): + args["target_ref"] = args["branch_name"] + + # Delete the file was created for the new branch. + file_delete_command(client=client, args=args, organization=project_args.organization, + repository_id=project_args.repository, project=project_args.project) + + readable_output = f'Branch {response.get("refUpdates", [])[0].get("name")} was created successfully by' \ + f' {response.get("pushedBy", {}).get("displayName")}.' + + return CommandResults( + readable_output=readable_output, + outputs_prefix='AzureDevOps.Branch', + outputs=response, + raw_response=response + ) + + +def pull_request_thread_create_command(client: Client, args: Dict[str, Any], organization: Optional[str], + repository_id: Optional[str], project: Optional[str]) -> CommandResults: + """ + Create a thread in a pull request. + """ + # pre-processing inputs + project_args = organization_repository_project_preprocess(args, organization, repository_id, project) + + response = client.create_pull_request_thread(project_args, args=args) + + readable_output = f'Thread {response.get("id")} was created successfully by' \ + f' {response.get("comments", [])[0].get("author", {}).get("displayName")}.' + + return CommandResults( + readable_output=readable_output, + outputs_prefix='AzureDevOps.PullRequestThread', + outputs=response, + raw_response=response + ) + + +def pull_request_thread_update_command(client: Client, args: Dict[str, Any], organization: Optional[str], + repository_id: Optional[str], project: Optional[str]) -> CommandResults: + """ + Update a thread in a pull request. + """ + # pre-processing inputs + project_args = organization_repository_project_preprocess(args, organization, repository_id, project) + + response = client.update_pull_request_thread(project_args, args=args) + + readable_output = f'Thread {response.get("id")} was updated successfully by' \ + f' {response.get("comments", [])[0].get("author", {}).get("displayName")}.' + + return CommandResults( + readable_output=readable_output, + outputs_prefix='AzureDevOps.PullRequestThread', + outputs=response, + raw_response=response + ) + + +def pull_request_thread_list_command(client: Client, args: Dict[str, Any], organization: Optional[str], + repository_id: Optional[str], project: Optional[str]) -> CommandResults: + """ + Retrieve all threads in a pull request. + """ + # pre-processing inputs + project_args = organization_repository_project_preprocess(args, organization, repository_id, project) + + response = client.list_pull_request_threads(project_args, args["pull_request_id"]) + + list_to_table: List[dict] = [] + for thread in response.get("value", []): + thread_id = thread.get("id") + list_to_table.extend( + { + "Thread ID": thread_id, + "Content": comment.get("content"), + "Name": comment.get("author").get("displayName"), + "Date": comment.get("publishedDate"), + } + for comment in thread.get("comments") + ) + + readable_output = tableToMarkdown( + "Threads", + list_to_table, + headers=["Thread ID", "Content", "Name", "Date"] + ) + + return CommandResults( + readable_output=readable_output, + outputs_prefix='AzureDevOps.PullRequestThread', + outputs=response.get("value"), + raw_response=response + ) + + +def project_team_list_command(client: Client, args: Dict[str, Any], organization: Optional[str], + project: Optional[str]) -> CommandResults: + """ + Get a list of teams. + """ + # pre-processing inputs + project_args = organization_repository_project_preprocess(args, organization, repository_id=None, project=project, + is_repository_id_required=False) + + response = client.list_project_teams(project_args) + + mapping = {"name": "Name"} + readable_output = tableToMarkdown( + "Teams", + response.get("value"), + headers=["name"], + headerTransform=lambda header: mapping.get(header, header), + ) + + return CommandResults( + readable_output=readable_output, + outputs_prefix='AzureDevOps.Team', + outputs=response.get("value"), + raw_response=response + ) + + +def team_member_list_command(client: Client, args: Dict[str, Any], organization: Optional[str], + project: Optional[str]) -> CommandResults: + """ + Get a list of members for a specific team. + """ + # pre-processing inputs + project_args = organization_repository_project_preprocess(args, organization, repository_id=None, project=project, + is_repository_id_required=False) + # pagination + limit, offset = pagination_preprocess_and_validation(args) + + response = client.list_team_members(project_args, args, limit, offset) + + list_for_hr: List[dict] = [] + list_for_hr.extend( + { + "Name": member.get("identity").get("displayName"), + "User ID": member.get("identity").get("id"), + "Unique Name": member.get("identity").get("uniqueName"), + } + for member in response.get("value") + ) + readable_output = tableToMarkdown( + "Team Members", + list_for_hr, + headers=["Name", "Unique Name", "User ID"], + ) + + return CommandResults( + readable_output=readable_output, + outputs_prefix='AzureDevOps.TeamMember', + outputs=response.get("value"), + raw_response=response + ) + + +def blob_zip_get_command(client: Client, args: Dict[str, Any], organization: Optional[str], + repository_id: Optional[str], project: Optional[str]) -> dict: + """ + Get a single blob. + """ + # pre-processing inputs + project_args = organization_repository_project_preprocess(args, organization, repository_id, project) + + response = client.get_blob_zip(project_args, args["file_object_id"]) + + return fileResult(filename=f'{args["file_object_id"]}.zip', data=response.content, file_type=EntryType.FILE) + + def fetch_incidents(client, project: str, repository: str, integration_instance: str, max_fetch: int = 50, first_fetch: str | None | datetime = None) -> None: """ @@ -1602,6 +2527,8 @@ def main() -> None: args: Dict[str, Any] = demisto.args() client_id = params['client_id'] organization = params['organization'] + repository = params.get("repository") + project = params.get("project") verify_certificate: bool = not params.get('insecure', False) proxy = params.get('proxy', False) is_mirroring = params.get('is_mirroring', False) @@ -1642,16 +2569,16 @@ def main() -> None: return_results(user_remove_command(client, args)) elif command == 'azure-devops-pull-request-create': - return_results(pull_request_create_command(client, args)) + return_results(pull_request_create_command(client, args, repository, project)) elif command == 'azure-devops-pull-request-get': return_results(pull_request_get_command(client, args)) elif command == 'azure-devops-pull-request-update': - return_results(pull_request_update_command(client, args)) + return_results(pull_request_update_command(client, args, repository, project)) elif command == 'azure-devops-pull-request-list': - return_results(pull_requests_list_command(client, args)) + return_results(pull_requests_list_command(client, args, repository, project)) elif command == 'azure-devops-project-list': return_results(project_list_command(client, args)) @@ -1672,7 +2599,7 @@ def main() -> None: return_results(pipeline_list_command(client, args)) elif command == 'azure-devops-branch-list': - return_results(branch_list_command(client, args)) + return_results(branch_list_command(client, args, repository, project)) elif command == 'test-module': return_results(test_module(client)) @@ -1693,13 +2620,76 @@ def main() -> None: elif command == 'update-remote-system': if is_mirroring: - return_results(update_remote_system_command(client, args)) + return_results(update_remote_system_command(client, args, repository, project)) + + elif command == 'azure-devops-pull-request-reviewer-list': + return_results(pull_request_reviewer_list_command(client, args, organization, repository, project)) + + elif command == 'azure-devops-pull-request-reviewer-add': + return_results(pull_request_reviewer_add_command(client, args, organization, repository, project)) + + elif command == 'azure-devops-pull-request-commit-list': + return_results(pull_request_commit_list_command(client, args, organization, repository, project)) + + elif command == 'azure-devops-commit-list': + return_results(commit_list_command(client, args, organization, repository, project)) + + elif command == 'azure-devops-commit-get': + return_results(commit_get_command(client, args, organization, repository, project)) + + elif command == 'azure-devops-work-item-get': + return_results(work_item_get_command(client, args, organization, repository, project)) + + elif command == 'azure-devops-work-item-create': + return_results(work_item_create_command(client, args, organization, repository, project)) + + elif command == 'azure-devops-work-item-update': + return_results(work_item_update_command(client, args, organization, repository, project)) + + elif command == 'azure-devops-file-create': + return_results(file_create_command(client, args, organization, repository, project)) + + elif command == 'azure-devops-file-update': + return_results(file_update_command(client, args, organization, repository, project)) + + elif command == 'azure-devops-file-delete': + return_results(file_delete_command(client, args, organization, repository, project)) + + elif command == 'azure-devops-file-list': + return_results(file_list_command(client, args, organization, repository, project)) + + elif command == 'azure-devops-file-get': + return_results(file_get_command(client, args, organization, repository, project)) + + elif command == 'azure-devops-branch-create': + return_results(branch_create_command(client, args, organization, repository, project)) + + elif command == 'azure-devops-pull-request-thread-create': + return_results(pull_request_thread_create_command(client, args, organization, repository, project)) + + elif command == 'azure-devops-pull-request-thread-update': + return_results(pull_request_thread_update_command(client, args, organization, repository, project)) + + elif command == 'azure-devops-pull-request-thread-list': + return_results(pull_request_thread_list_command(client, args, organization, repository, project)) + + elif command == 'azure-devops-project-team-list': + return_results(project_team_list_command(client, args, organization, project)) + + elif command == 'azure-devops-team-member-list': + return_results(team_member_list_command(client, args, organization, project)) + + elif command == 'azure-devops-blob-zip-get': + return_results(blob_zip_get_command(client, args, organization, repository, project)) else: raise NotImplementedError(f'{command} command is not implemented.') except Exception as e: demisto.error(traceback.format_exc()) + if isinstance(e, NotFoundError): + return_error(f"{str(e)}. There is a possibility that the organization's name is incorrect") + return return_error(str(e)) diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/AzureDevOps.yml b/Packs/AzureDevOps/Integrations/AzureDevOps/AzureDevOps.yml index 66dacdb61102..496e7479e8ea 100644 --- a/Packs/AzureDevOps/Integrations/AzureDevOps/AzureDevOps.yml +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/AzureDevOps.yml @@ -21,14 +21,14 @@ configuration: name: max_fetch type: 0 required: false -- additionalinfo: The name of the project which the pull requests belongs to. A project name can be obtained by running the 'azure-devops-project-list' command. This argument is mandatory for Fetch functionality. - display: Pull-request project name +- additionalinfo: The name of the project which the pull requests belongs to. A project name can be obtained by running the 'azure-devops-project-list' command. This argument is mandatory for Fetch functionality and will be the default value in all the commands. You can override the default using the command argument. + display: Default Project Name name: project type: 0 defaultvalue: required: false -- additionalinfo: The name of the repository pull request's target branch. A repository name can be obtained by running the 'azure-devops-repository-list' command. This argument is mandatory for Fetch functionality. - display: Pull-request repository name +- additionalinfo: The name of the repository pull request's target branch. A repository name can be obtained by running the 'azure-devops-repository-list' command. This argument is mandatory for Fetch functionality and will be the default value in all the commands. You can override the default using the command argument. + display: Default Repository Name name: repository type: 0 defaultvalue: @@ -224,12 +224,12 @@ script: name: azure-devops-user-remove outputs: [] - arguments: - - description: The name or ID of the project. + - description: The name or ID of the project. A default value is taken from the configuration parameters, but you can override it. name: project - required: true - - description: The repository ID of the pull request's target branch. A repository ID can be obtained by running the 'azure-devops-repository-list' command. + required: false + - description: The repository ID. A repository ID can be obtained by running the 'azure-devops-repository-list' command. A default value is taken from the configuration parameters, but you can override it. name: repository_id - required: true + required: false - description: The name of the source branch of the pull request. name: source_branch required: true @@ -245,7 +245,7 @@ script: - description: Comma-separated list of the pull request reviewers IDs. A reviewer ID can be obtained by running the 'azure-devops-user-list' command. isArray: true name: reviewers_ids - required: true + required: false description: Create a new pull request. name: azure-devops-pull-request-create outputs: @@ -313,12 +313,12 @@ script: description: The REST URL for this resource. type: String - arguments: - - description: The name or ID of the project. + - description: The name or ID of the project. A default value is taken from the configuration parameters, but you can override it. name: project - required: true - - description: The repository ID of the pull request's target branch. A repository ID can be obtained by running the 'azure-devops-repository-list' command. + required: false + - description: The repository ID. A repository ID can be obtained by running the 'azure-devops-repository-list' command. A default value is taken from the configuration parameters, but you can override it. name: repository_id - required: true + required: false - description: The ID of the pull request to update. name: pull_request_id required: true @@ -400,12 +400,12 @@ script: description: The REST URL for this resource. type: String - arguments: - - description: The name or ID of the project which the pull requests belongs to. + - description: The name or ID of the project which the pull requests belongs to. A default value is taken from the configuration parameters, but you can override it. name: project - required: true - - description: The name of the repository pull request's target branch. + required: false + - description: The name of the repository pull request's target branch. A default value is taken from the configuration parameters, but you can override it. name: repository - required: true + required: false - defaultValue: '1' description: The page number of the results to retrieve. Minimum value is 1. name: page @@ -557,7 +557,7 @@ script: - description: The name or ID of the project. name: project required: true - - description: The repository ID of the pull request's target branch. A repository ID can be obtained by running the 'azure-devops-repository-list' command. + - description: The repository ID. A repository ID can be obtained by running the 'azure-devops-repository-list' command. name: repository_id required: true - description: The ID of the pull request to retrieve. @@ -749,12 +749,12 @@ script: description: Pipeline folder. type: String - arguments: - - description: The name of the organization project. + - description: The name of the organization project. A default value is taken from the configuration parameters, but you can override it. name: project - required: true - - description: The name of the project repository. + required: false + - description: The name of the project repository. A default value is taken from the configuration parameters, but the user can override it. name: repository - required: true + required: false - defaultValue: '1' description: The page number of the results to retrieve. Minimum value is 1. name: page @@ -773,10 +773,2220 @@ script: - contextPath: AzureDevOps.Branch.name description: The name of the branch. type: String + - description: Retrieve the reviewers for a pull request. + name: azure-devops-pull-request-reviewer-list + arguments: + - name: organization_name + description: The name of the Azure DevOps organization. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: project_name + description: Project ID or project name. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: repository_id + description: The repository ID. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: pull_request_id + description: ID of the pull request. By using the azure-devops-pull-request-list command, you can obtain the ID. + required: true + isArray: false + outputs: + - type: String + contextPath: AzureDevOps.PullRequestReviewer.reviewerUrl + description: URL to retrieve information about the reviewer. + - type: Number + contextPath: AzureDevOps.PullRequestReviewer.vote + description: Vote on a pull request, 10 - approved, 5 - approved with suggestions, 0 - no vote, -5 - waiting for author, -10 - rejected. + - type: Boolean + contextPath: AzureDevOps.PullRequestReviewer.hasDeclined + description: Whether the pull request has been declined. + - type: Boolean + contextPath: AzureDevOps.PullRequestReviewer.isRequired + description: Indicates if this is a required reviewer for this pull request. Branches can have policies that require particular reviewers are required for pull requests. + - type: Boolean + contextPath: AzureDevOps.PullRequestReviewer.isFlagged + description: A way to mark some special pull requests we are dealing with to distinguish them from other pull requests. + - type: String + contextPath: AzureDevOps.PullRequestReviewer.displayName + description: This is the non-unique display name of the graph subject. You can only change this field in the source provider. + - type: String + contextPath: AzureDevOps.PullRequestReviewer.url + description: REST URL for this resource. + - type: String + contextPath: AzureDevOps.PullRequestReviewer._links.avatar.href + description: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. + - type: String + contextPath: AzureDevOps.PullRequestReviewer.id + description: The ID of the pull request reviewer. + - type: String + contextPath: AzureDevOps.PullRequestReviewer.uniqueName + description: The user name of the reviewer. + - type: String + contextPath: AzureDevOps.PullRequestReviewer.imageUrl + description: Link to the reviewer's user image. + - name: azure-devops-pull-request-reviewer-add + description: Add a reviewer to a pull request. + arguments: + - name: organization_name + description: The name of the Azure DevOps organization. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: repository_id + description: The repository ID. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: project_name + description: Project ID or project name. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: reviewer_user_id + description: ID of the reviewer. By using the azure-devops-user-list command, you can obtain the user ID. + required: true + isArray: false + - name: is_required + description: Indicates if this is a required reviewer for this pull request. Branches can have policies that require particular reviewers are required for pull requests. + required: false + isArray: false + defaultValue: false + auto: PREDEFINED + predefined: + - 'True' + - 'False' + - name: pull_request_id + description: ID of the pull request. + required: true + isArray: false + outputs: + - type: String + contextPath: AzureDevOps.PullRequestReviewer.reviewerUrl + description: URL to retrieve information about this identity. + - type: Number + contextPath: AzureDevOps.PullRequestReviewer.vote + description: Vote on a pull request, 10 - approved, 5 - approved with suggestions, 0 - no vote, -5 - waiting for author, -10 - rejected. + - type: Boolean + contextPath: AzureDevOps.PullRequestReviewer.hasDeclined + description: Whether the pull request has been declined. + - type: Boolean + contextPath: AzureDevOps.PullRequestReviewer.isFlagged + description: A way to mark some special Pull Requests we are dealing with to distinguish them from other Pull Requests. + - type: String + contextPath: AzureDevOps.PullRequestReviewer._links.avatar.href + description: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. + - type: String + contextPath: AzureDevOps.PullRequestReviewer.id + description: ID of the pull request reviewer. + - type: String + contextPath: AzureDevOps.PullRequestReviewer.displayName + description: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. + - type: String + contextPath: AzureDevOps.PullRequestReviewer.uniqueName + description: The user name of the pull request reviewer. + - type: String + contextPath: AzureDevOps.PullRequestReviewer.url + description: REST URL for this resource. + - type: String + contextPath: AzureDevOps.PullRequestReviewer.imageUrl + description: Link to the reviewer's user image. + - name: azure-devops-pull-request-commit-list + description: Get the commits for the specified pull request. + arguments: + - name: organization_name + description: The name of the Azure DevOps organization. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: project_name + description: Project ID or project name. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: repository_id + description: The repository ID. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: pull_request_id + description: ID of the pull request. By using the azure-devops-pull-request-list command, you can obtain the ID. + required: true + isArray: false + - defaultValue: '50' + description: The maximum number of results to retrieve. Minimum value is 1. + name: limit + outputs: + - type: String + contextPath: AzureDevOps.Commit.commitId + description: ID (SHA-1) of the commit. + - type: String + contextPath: AzureDevOps.Commit.author.name + description: Name of the commit author. + - type: String + contextPath: AzureDevOps.Commit.author.email + description: Email address of the commit author. + - type: Date + contextPath: AzureDevOps.Commit.author.date + description: Date of the commit operation. + - type: String + contextPath: AzureDevOps.Commit.committer.name + description: Name of the commit committer. + - type: String + contextPath: AzureDevOps.Commit.committer.email + description: Email address of the commit committer. + - type: Date + contextPath: AzureDevOps.Commit.committer.date + description: Date of the commit operation. + - type: String + contextPath: AzureDevOps.Commit.comment + description: Comment or message of the commit. + - type: String + contextPath: AzureDevOps.Commit.url + description: REST URL for this resource. + - name: azure-devops-commit-list + description: Retrieve Git commits for a project. + arguments: + - name: organization_name + description: The name of the Azure DevOps organization. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: project_name + description: Project ID or project name. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: repository_id + description: The repository ID. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - defaultValue: '50' + description: The maximum number of results to retrieve. Minimum value is 1. + name: limit + - defaultValue: '1' + description: The page number of the results to retrieve. Minimum value is 1. + name: page + outputs: + - type: String + contextPath: AzureDevOps.Commit.commitId + description: ID (SHA-1) of the commit. + - type: String + contextPath: AzureDevOps.Commit.author.name + description: Name of the commit author. + - type: String + contextPath: AzureDevOps.Commit.author.email + description: Email address of the commit author. + - type: Date + contextPath: AzureDevOps.Commit.author.date + description: Date of the commit operation. + - type: String + contextPath: AzureDevOps.Commit.committer.name + description: Name of the commit committer. + - type: String + contextPath: AzureDevOps.Commit.committer.email + description: Email address of the commit committer. + - type: Date + contextPath: AzureDevOps.Commit.committer.date + description: Date of the commit operation. + - type: String + contextPath: AzureDevOps.Commit.comment + description: Comment or message of the commit. + - type: Number + contextPath: AzureDevOps.Commit.changeCounts + description: Counts of the types of changes (edits, deletes, etc.) included with the commit. + - type: String + contextPath: AzureDevOps.Commit.url + description: REST URL for this resource. + - type: String + contextPath: AzureDevOps.Commit.remoteUrl + description: Remote URL path to the commit. + - name: azure-devops-commit-get + description: Retrieve a particular commit. + arguments: + - name: organization_name + description: The name of the Azure DevOps organization. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: project_name + description: Project ID or project name. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: repository_id + description: The repository ID. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: commit_id + description: The ID of the commit. + required: true + isArray: false + outputs: + - type: String + contextPath: AzureDevOps.Commit.treeId + description: Tree ID of the commit. + - type: String + contextPath: AzureDevOps.Commit.commitId + description: ID (SHA-1) of the commit. + - type: String + contextPath: AzureDevOps.Commit.author.name + description: Name of the commit author. + - type: String + contextPath: AzureDevOps.Commit.author.email + description: Email address of the commit author. + - type: Date + contextPath: AzureDevOps.Commit.author.date + description: Date of the commit operation. + - type: String + contextPath: AzureDevOps.Commit.author.imageUrl + description: Link to the author user image. + - type: String + contextPath: AzureDevOps.Commit.committer.name + description: Name of the commit committer. + - type: String + contextPath: AzureDevOps.Commit.committer.email + description: Email address of the commit committer. + - type: Date + contextPath: AzureDevOps.Commit.committer.date + description: Date of the commit operation. + - type: String + contextPath: AzureDevOps.Commit.committer.imageUrl + description: Link to the committer user image. + - type: String + contextPath: AzureDevOps.Commit.comment + description: Comment or message of the commit. + - type: String + contextPath: AzureDevOps.Commit.parents + description: An enumeration of the parent commit IDs for this commit. + - type: String + contextPath: AzureDevOps.Commit.url + description: REST URL for this resource. + - type: String + contextPath: AzureDevOps.Commit.remoteUrl + description: Remote URL path to the commit. + - type: String + contextPath: AzureDevOps.Commit._links.self.href + description: A collection of related REST reference links. + - type: String + contextPath: AzureDevOps.Commit._links.repository.href + description: Link to the repository where the commit is. + - type: String + contextPath: AzureDevOps.Commit._links.web.href + description: Link to the commit. + - type: String + contextPath: AzureDevOps.Commit._links.changes.href + description: Link to the commit changes. + - type: String + contextPath: AzureDevOps.Commit.push.pushedBy.displayName + description: Display name of the user who pushed the commit. + - type: String + contextPath: AzureDevOps.Commit.push.pushedBy.url + description: Identity reference. + - type: String + contextPath: AzureDevOps.Commit.push.pushedBy._links.avatar.href + description: URL for the user's avatar. + - type: String + contextPath: AzureDevOps.Commit.push.pushedBy.id + description: ID of the user who pushed the commit. + - type: String + contextPath: AzureDevOps.Commit.push.pushedBy.uniqueName + description: The unique name of the user who pushed the commit. + - type: String + contextPath: AzureDevOps.Commit.push.pushedBy.imageUrl + description: The user's image who pushed the commit. + - type: String + contextPath: AzureDevOps.Commit.push.pushedBy.descriptor + description: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + - type: Number + contextPath: AzureDevOps.Commit.push.pushId + description: Unique ID of the push operation. + - type: Date + contextPath: AzureDevOps.Commit.push.date + description: Date of the push operation. + - name: azure-devops-work-item-get + description: Returns a single work item. + arguments: + - name: organization_name + description: The name of the Azure DevOps organization. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: project_name + description: Project ID or project name. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: item_id + description: The work item ID. + required: true + isArray: false + outputs: + - type: Number + contextPath: AzureDevOps.WorkItem.id + description: The work item ID. + - type: Number + contextPath: AzureDevOps.WorkItem.rev + description: Revision number of the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.AreaPath + description: The work item AreaPath. Area paths allow you to group work items by team, product, or feature area. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.TeamProject + description: The work item TeamProject. A group of project members focused on specific products, services, or feature areas. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.IterationPath + description: The work item IterationPath. Iteration paths allow you to group work into sprints, milestones, or other event-specific or time-related period. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.WorkItemType + description: The work item type. Epic, Feature, User Story and Task/Bug. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.State + description: Workflow states define how a work item progresses from its creation to closure. The four main states that are defined for the User Story describe a user story's progression. The workflow states are New, Active, Resolved, and Closed. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.Reason + description: This reason for the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.AssignedTo.displayName + description: Display name of the user assigned to the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.AssignedTo.url + description: The work item URL. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.AssignedTo._links.avatar.href + description: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.AssignedTo.id + description: ID of the user assigned to the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.AssignedTo.uniqueName + description: The unique name of the user assigned to the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.AssignedTo.imageUrl + description: Link to the user (assigned to the work item) image. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.AssignedTo.descriptor + description: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + - type: Date + contextPath: AzureDevOps.WorkItem.fields.System.CreatedDate + description: 'The run creation date, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z".' + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy.displayName + description: Display name of the user who created the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy.url + description: The work item URL. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy._links.avatar.href + description: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy.id + description: ID of the user who created the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy.uniqueName + description: The unique name of the user who created the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy.imageUrl + description: Link to the user (created the work item) image. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy.descriptor + description: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + - type: Date + contextPath: AzureDevOps.WorkItem.fields.System.ChangedDate + description: 'The datetime the run was changed, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z".' + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy.displayName + description: Display name of the user who changed the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy.url + description: The work item URL. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy._links.avatar.href + description: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy.id + description: ID of the user who changed the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy.uniqueName + description: The unique name of the user who changed the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy.imageUrl + description: Link to the user (changed the work item) image. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy.descriptor + description: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + - type: Number + contextPath: AzureDevOps.WorkItem.fields.System.CommentCount + description: Count of the work item comments. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.Title + description: The work item title. + - type: Date + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.StateChangeDate + description: 'The datetime the state was changed, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z".' + - type: Date + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedDate + description: 'The activated date, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z".' + - type: String + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.displayName + description: Display name of the user who activated the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.url + description: The work item URL. + - type: String + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy._links.avatar.href + description: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. + - type: String + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.id + description: ID of the user who activated the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.uniqueName + description: The unique name of the user who activated the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.imageUrl + description: Link to the user (activated the work item) image. + - type: String + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.descriptor + description: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + - type: Number + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.Priority + description: This field specifies which work the team should do first. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.Description + description: The work item description. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.Tags + description: Tags related to the work item. + - type: String + contextPath: AzureDevOps.WorkItem._links.self.href + description: A collection of related REST reference links. + - type: String + contextPath: AzureDevOps.WorkItem._links.workItemUpdates.href + description: Link to the work item updates. + - type: String + contextPath: AzureDevOps.WorkItem._links.workItemRevisions.href + description: Link to the work item revisions. + - type: String + contextPath: AzureDevOps.WorkItem._links.workItemComments.href + description: Link to the work item comments. + - type: String + contextPath: AzureDevOps.WorkItem._links.html.href + description: Link to the work item HTML. + - type: String + contextPath: AzureDevOps.WorkItem._links.workItemType.href + description: Link to the work item type. + - type: String + contextPath: AzureDevOps.WorkItem._links.fields.href + description: Link to the work item fields. + - type: String + contextPath: AzureDevOps.WorkItem.url + description: Link to the work item. + - name: azure-devops-work-item-create + description: Creates a single work item. + arguments: + - name: organization_name + description: The name of the Azure DevOps organization. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: project_name + description: Project ID or project name. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - auto: PREDEFINED + predefined: + - Task + - Epic + - Issue + name: type + description: The work item type of the work item to create. + required: true + isArray: false + - name: title + description: The work item title of the work item to create. + required: true + isArray: false + - name: iteration_path + description: The path for the operation. + required: false + isArray: false + - name: description + description: Describes the work item. + required: false + isArray: false + - auto: PREDEFINED + predefined: + - '1' + - '2' + - '3' + - '4' + name: priority + description: Which work the team should do first. + required: false + isArray: false + - name: tag + description: Tag related to the work item. + required: false + isArray: false + outputs: + - type: Number + contextPath: AzureDevOps.WorkItem.id + description: The work item ID. + - type: Number + contextPath: AzureDevOps.WorkItem.rev + description: Revision number of the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.AreaPath + description: The work item AreaPath. Area paths allow you to group work items by team, product, or feature area. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.TeamProject + description: The work item TeamProject. A group of project members focused on specific products, services, or feature areas. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.IterationPath + description: The work item IterationPath. Iteration paths allow you to group work into sprints, milestones, or other event-specific or time-related period. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.WorkItemType + description: The work item type. Epic, Feature, User Story and Task/Bug. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.State + description: Workflow states define how a work item progresses from its creation to closure. The four main states that are defined for the User Story describe a user story's progression. The workflow states are New, Active, Resolved, and Closed. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.Reason + description: This reason for the work item. + - type: Date + contextPath: AzureDevOps.WorkItem.fields.System.CreatedDate + description: 'The run creation date, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z".' + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy.displayName + description: Display name of user created the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy.url + description: The work item URL. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy._links.avatar.href + description: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy.id + description: ID of the user who created the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy.uniqueName + description: The unique name of the user who created the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy.imageUrl + description: Link to the user (created the work item) image. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy.descriptor + description: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + - type: Date + contextPath: AzureDevOps.WorkItem.fields.System.ChangedDate + description: 'The datetime the run was changed, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z".' + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy.displayName + description: Display name of the user who changed the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy.url + description: The work item URL. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy._links.avatar.href + description: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy.id + description: ID of the user who changed the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy.uniqueName + description: The unique name of the user who changed the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy.imageUrl + description: Link to the user (changed the work item) image. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy.descriptor + description: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + - type: Number + contextPath: AzureDevOps.WorkItem.fields.System.CommentCount + description: Count of the work item comments. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.Title + description: The work item title. + - type: Date + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.StateChangeDate + description: 'The datetime the state was changed, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z".' + - type: Number + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.Priority + description: This field specifies which work the team should do first. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.Description + description: The work item description. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.Tags + description: Tags related to the work item. + - type: String + contextPath: AzureDevOps.WorkItem._links.self.href + description: A collection of related REST reference links. + - type: String + contextPath: AzureDevOps.WorkItem._links.workItemUpdates.href + description: Link to the work item updates. + - type: String + contextPath: AzureDevOps.WorkItem._links.workItemRevisions.href + description: Link to the work item revisions. + - type: String + contextPath: AzureDevOps.WorkItem._links.workItemComments.href + description: Link to the work item comments. + - type: String + contextPath: AzureDevOps.WorkItem._links.html.href + description: Link to the work item HTML. + - type: String + contextPath: AzureDevOps.WorkItem._links.workItemType.href + description: Link to the work item type. + - type: String + contextPath: AzureDevOps.WorkItem._links.fields.href + description: Link to the work item fields. + - type: String + contextPath: AzureDevOps.WorkItem.url + description: Link to the work item. + - name: azure-devops-work-item-update + description: Updates a single work item. + arguments: + - name: organization_name + description: The name of the Azure DevOps organization. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: project_name + description: Project ID or project name. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: repository_id + description: The repository ID. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: item_id + description: The work item ID to update. + required: true + isArray: false + - name: title + description: A new title for the work item. + required: false + isArray: false + - name: assignee_display_name + description: Display name of user assigned to the work item. This argument can be obtained by running the 'azure-devops-user-list' command. + required: false + isArray: false + - auto: PREDEFINED + predefined: + - To Do + - Doing + - Done + name: state + description: A new state for the work item. + required: false + isArray: false + - name: iteration_path + description: A new path for the operation. + required: false + isArray: false + - name: description + description: A new description for the work item. + required: false + isArray: false + - auto: PREDEFINED + predefined: + - '1' + - '2' + - '3' + - '4' + name: priority + description: A new priority for the work item. + required: false + isArray: false + - name: tag + description: A new tag for the work item. + required: false + isArray: false + outputs: + - type: Number + contextPath: AzureDevOps.WorkItem.id + description: The work item ID. + - type: Number + contextPath: AzureDevOps.WorkItem.rev + description: Revision number of the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.AreaPath + description: The work item AreaPath. Area paths allow you to group work items by team, product, or feature area. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.TeamProject + description: The work item TeamProject. A group of project members focused on specific products, services, or feature areas. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.IterationPath + description: The work item IterationPath. Iteration paths allow you to group work into sprints, milestones, or other event-specific or time-related period. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.WorkItemType + description: The work item type. Epic, Feature, User Story and Task/Bug. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.State + description: Workflow states define how a work item progresses from its creation to closure. The four main states that are defined for the User Story describe a user story's progression. The workflow states are New, Active, Resolved, and Closed. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.Reason + description: This reason for the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.AssignedTo.displayName + description: Display name of user assigned to the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.AssignedTo.url + description: The work item URL. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.AssignedTo._links.avatar.href + description: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.AssignedTo.id + description: ID of the user assigned to the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.AssignedTo.uniqueName + description: The unique name of the user assigned to the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.AssignedTo.imageUrl + description: Link to the user (assigned to the work item) image. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.AssignedTo.descriptor + description: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + - type: Date + contextPath: AzureDevOps.WorkItem.fields.System.CreatedDate + description: 'The run creation date, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z".' + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy.displayName + description: Display name of the user who created the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy.url + description: The work item URL. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy._links.avatar.href + description: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy.id + description: ID of the user who created the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy.uniqueName + description: The unique name of the user who created the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy.imageUrl + description: Link to the user (created the work item) image. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.CreatedBy.descriptor + description: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + - type: Date + contextPath: AzureDevOps.WorkItem.fields.System.ChangedDate + description: 'The datetime the run was changed, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z".' + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy.displayName + description: Display name of the user who changed the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy.url + description: The work item URL. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy._links.avatar.href + description: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy.id + description: ID of the user who changed the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy.uniqueName + description: The unique name of the user who changed the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy.imageUrl + description: Link to the user (changed the work item) image. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.ChangedBy.descriptor + description: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + - type: Number + contextPath: AzureDevOps.WorkItem.fields.System.CommentCount + description: Count of the work item comments. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.Title + description: The work item title. + - type: Date + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.StateChangeDate + description: 'The datetime the state was changed, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z".' + - type: Date + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedDate + description: 'The activated date, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z".' + - type: String + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.displayName + description: Display name of the user who activated the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.url + description: The work item URL. + - type: String + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy._links.avatar.href + description: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. + - type: String + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.id + description: ID of the user who activated the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.uniqueName + description: The unique name of the user who activated the work item. + - type: String + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.imageUrl + description: Link to the user (activated the work item) image. + - type: String + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.descriptor + description: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + - type: Number + contextPath: AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.Priority + description: This field specifies which work the team should do first. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.Description + description: The work item description. + - type: String + contextPath: AzureDevOps.WorkItem.fields.System.Tags + description: Tags related to the work item. + - type: String + contextPath: AzureDevOps.WorkItem._links.self.href + description: A collection of related REST reference links. + - type: String + contextPath: AzureDevOps.WorkItem._links.workItemUpdates.href + description: Link to the work item updates. + - type: String + contextPath: AzureDevOps.WorkItem._links.workItemRevisions.href + description: Link to the work item revisions. + - type: String + contextPath: AzureDevOps.WorkItem._links.workItemComments.href + description: Link to the work item comments. + - type: String + contextPath: AzureDevOps.WorkItem._links.html.href + description: Link to the work item HTML. + - type: String + contextPath: AzureDevOps.WorkItem._links.workItemType.href + description: Link to the work item type. + - type: String + contextPath: AzureDevOps.WorkItem._links.fields.href + description: Link to the work item fields. + - type: String + contextPath: AzureDevOps.WorkItem.url + description: Link to the work item. + - name: azure-devops-file-create + description: Add a file to the repository. + arguments: + - name: organization_name + description: The name of the Azure DevOps organization. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: project_name + description: Project ID or project name. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: repository_id + description: The repository ID. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: branch_name + description: The branch name. This argument can be obtained by running the 'azure-devops-branch-list' command. + required: true + isArray: false + - name: commit_comment + description: Comment or message of the commit. + required: true + isArray: false + - name: file_path + description: The file path. + required: false + isArray: false + - name: file_content + description: The file content. + required: false + isArray: false + - name: entry_id + description: There is an option to the user to provide an entry_id. In that case we will take the file_content and the file_path from the given id. + required: false + isArray: false + outputs: + - type: String + contextPath: AzureDevOps.File.commits.treeId + description: Tree ID of the commit. + - type: String + contextPath: AzureDevOps.File.commits.commitId + description: ID (SHA-1) of the commit. + - type: String + contextPath: AzureDevOps.File.commits.author.name + description: Name of the commit author. + - type: String + contextPath: AzureDevOps.File.commits.author.email + description: Email address of the commit author. + - type: Date + contextPath: AzureDevOps.File.commits.author.date + description: Date of the commit operation. + - type: String + contextPath: AzureDevOps.File.commits.committer.name + description: Name of the commit committer. + - type: String + contextPath: AzureDevOps.File.commits.committer.email + description: Email address of the commit committer. + - type: Date + contextPath: AzureDevOps.File.commits.committer.date + description: Date of the commit operation. + - type: String + contextPath: AzureDevOps.File.commits.comment + description: Comment or message of the commit. + - type: String + contextPath: AzureDevOps.File.commits.parents + description: An enumeration of the parent commit IDs for this commit. + - type: String + contextPath: AzureDevOps.File.commits.url + description: REST URL for this resource. + - type: String + contextPath: AzureDevOps.File.refUpdates.repositoryId + description: The ID of the repository. + - type: String + contextPath: AzureDevOps.File.refUpdates.name + description: The branch name. + - type: String + contextPath: AzureDevOps.File.refUpdates.oldObjectId + description: The last commit ID. + - type: String + contextPath: AzureDevOps.File.refUpdates.newObjectId + description: The new commit ID. + - type: String + contextPath: AzureDevOps.File.repository.id + description: The ID of the repository. + - type: String + contextPath: AzureDevOps.File.repository.name + description: The name of the repository. + - type: String + contextPath: AzureDevOps.File.repository.url + description: The URL of the repository. + - type: String + contextPath: AzureDevOps.File.repository.project.id + description: The ID of the project. + - type: String + contextPath: AzureDevOps.File.repository.project.name + description: The name of the project. + - type: String + contextPath: AzureDevOps.File.repository.project.description + description: The description of the project. + - type: String + contextPath: AzureDevOps.File.repository.project.url + description: The URL of the project. + - type: String + contextPath: AzureDevOps.File.repository.project.state + description: The state of the project. + - type: Number + contextPath: AzureDevOps.File.repository.project.revision + description: The revision number of the project. + - type: String + contextPath: AzureDevOps.File.repository.project.visibility + description: Indicates to whom the project is visible. + - type: Date + contextPath: AzureDevOps.File.repository.project.lastUpdateTime + description: 'The project last update time, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z".' + - type: Number + contextPath: AzureDevOps.File.repository.size + description: The size of the repository (in bytes). + - type: String + contextPath: AzureDevOps.File.repository.remoteUrl + description: Remote URL path to the repository. + - type: String + contextPath: AzureDevOps.File.repository.sshUrl + description: The SSH URL of the repository. + - type: String + contextPath: AzureDevOps.File.repository.webUrl + description: The web URL of the repository. + - type: Boolean + contextPath: AzureDevOps.File.repository.isDisabled + description: If the repository is disabled or not. + - type: Boolean + contextPath: AzureDevOps.File.repository.isInMaintenance + description: If the repository is in maintenance or not. + - type: String + contextPath: AzureDevOps.File.pushedBy.displayName + description: Display name of the user who pushed the commit / file. + - type: String + contextPath: AzureDevOps.File.pushedBy.url + description: Identity reference. + - type: String + contextPath: AzureDevOps.File.pushedBy._links.avatar.href + description: URL for the user's avatar. + - type: String + contextPath: AzureDevOps.File.pushedBy.id + description: ID of the user who pushed the commit / file. + - type: String + contextPath: AzureDevOps.File.pushedBy.uniqueName + description: The unique name of the user who pushed the commit. + - type: String + contextPath: AzureDevOps.File.pushedBy.imageUrl + description: Identity image. + - type: String + contextPath: AzureDevOps.File.pushedBy.descriptor + description: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + - type: Number + contextPath: AzureDevOps.File.pushId + description: Unique ID of the push operation. + - type: Date + contextPath: AzureDevOps.File.date + description: Date of the operation. + - type: String + contextPath: AzureDevOps.File.url + description: Link to the commit. + - type: String + contextPath: AzureDevOps.File._links.self.href + description: A collection of related REST reference links. + - type: String + contextPath: AzureDevOps.File._links.repository.href + description: Link to the repository where the commit is. + - type: String + contextPath: AzureDevOps.File._links.commits.href + description: Link to the commits. + - type: String + contextPath: AzureDevOps.File._links.pusher.href + description: Link to the commit pusher. + - type: String + contextPath: AzureDevOps.File._links.refs.href + description: Link to the branch. + - name: azure-devops-file-update + description: Update a file in the repository. + arguments: + - name: organization_name + description: The name of the Azure DevOps organization. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: project_name + description: Project ID or project name. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: repository_id + description: The repository ID. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: branch_name + description: The branch name. This argument can be obtained by running the 'azure-devops-branch-list' command. + required: true + isArray: false + - name: commit_comment + description: Comment or message of the commit. + required: true + isArray: false + - name: file_path + description: The file path. + required: false + isArray: false + - name: file_content + description: The file content. + required: false + isArray: false + - name: entry_id + description: There is an option to the user to provide an entry_id. In that case we will take the file_content and the file_path from the given id. + required: false + isArray: false + outputs: + - type: String + contextPath: AzureDevOps.File.commits.treeId + description: Tree ID of the commit. + - type: String + contextPath: AzureDevOps.File.commits.commitId + description: ID (SHA-1) of the commit. + - type: String + contextPath: AzureDevOps.File.commits.author.name + description: Name of the commit author. + - type: String + contextPath: AzureDevOps.File.commits.author.email + description: Email address of the commit author. + - type: Date + contextPath: AzureDevOps.File.commits.author.date + description: Date of the commit operation. + - type: String + contextPath: AzureDevOps.File.commits.committer.name + description: Name of the commit committer. + - type: String + contextPath: AzureDevOps.File.commits.committer.email + description: Email address of the commit committer. + - type: Date + contextPath: AzureDevOps.File.commits.committer.date + description: Date of the commit operation. + - type: String + contextPath: AzureDevOps.File.commits.comment + description: Comment or message of the commit. + - type: String + contextPath: AzureDevOps.File.commits.parents + description: An enumeration of the parent commit IDs for this commit. + - type: String + contextPath: AzureDevOps.File.commits.url + description: REST URL for this resource. + - type: String + contextPath: AzureDevOps.File.refUpdates.repositoryId + description: The ID of the repository. + - type: String + contextPath: AzureDevOps.File.refUpdates.name + description: The branch name. + - type: String + contextPath: AzureDevOps.File.refUpdates.oldObjectId + description: The last commit ID. + - type: String + contextPath: AzureDevOps.File.refUpdates.newObjectId + description: The new commit ID. + - type: String + contextPath: AzureDevOps.File.repository.id + description: The ID of the repository. + - type: String + contextPath: AzureDevOps.File.repository.name + description: The name of the repository. + - type: String + contextPath: AzureDevOps.File.repository.url + description: The URL of the repository. + - type: String + contextPath: AzureDevOps.File.repository.project.id + description: The ID of the project. + - type: String + contextPath: AzureDevOps.File.repository.project.name + description: The name of the project. + - type: String + contextPath: AzureDevOps.File.repository.project.description + description: The description of the project. + - type: String + contextPath: AzureDevOps.File.repository.project.url + description: The URL of the project. + - type: String + contextPath: AzureDevOps.File.repository.project.state + description: The state of the project. + - type: Number + contextPath: AzureDevOps.File.repository.project.revision + description: The revision number of the project. + - type: String + contextPath: AzureDevOps.File.repository.project.visibility + description: Indicates whom the project is visible to. + - type: Date + contextPath: AzureDevOps.File.repository.project.lastUpdateTime + description: 'The project last update time, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z".' + - type: Number + contextPath: AzureDevOps.File.repository.size + description: The size of the repository (in bytes). + - type: String + contextPath: AzureDevOps.File.repository.remoteUrl + description: Remote URL path to the repository. + - type: String + contextPath: AzureDevOps.File.repository.sshUrl + description: The SSH URL of the repository. + - type: String + contextPath: AzureDevOps.File.repository.webUrl + description: The web URL of the repository. + - type: Boolean + contextPath: AzureDevOps.File.repository.isDisabled + description: If the repository is disabled or not. + - type: Boolean + contextPath: AzureDevOps.File.repository.isInMaintenance + description: If the repository is in maintenance or not. + - type: String + contextPath: AzureDevOps.File.pushedBy.displayName + description: Display name of the user who pushed the commit / file. + - type: String + contextPath: AzureDevOps.File.pushedBy.url + description: Identity reference. + - type: String + contextPath: AzureDevOps.File.pushedBy._links.avatar.href + description: URL for the user's avatar. + - type: String + contextPath: AzureDevOps.File.pushedBy.id + description: ID of the user who pushed the commit / file. + - type: String + contextPath: AzureDevOps.File.pushedBy.uniqueName + description: The unique name of the user who pushed the commit. + - type: String + contextPath: AzureDevOps.File.pushedBy.imageUrl + description: Identity image. + - type: String + contextPath: AzureDevOps.File.pushedBy.descriptor + description: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + - type: Number + contextPath: AzureDevOps.File.pushId + description: Unique ID of the push operation. + - type: Date + contextPath: AzureDevOps.File.date + description: Date of the operation. + - type: String + contextPath: AzureDevOps.File.url + description: Link to the commit. + - type: String + contextPath: AzureDevOps.File._links.self.href + description: A collection of related REST reference links. + - type: String + contextPath: AzureDevOps.File._links.repository.href + description: Link to the repository where the commit is. + - type: String + contextPath: AzureDevOps.File._links.commits.href + description: Link to the commits. + - type: String + contextPath: AzureDevOps.File._links.pusher.href + description: Link to the commit pusher. + - type: String + contextPath: AzureDevOps.File._links.refs.href + description: Link to the branch. + - name: azure-devops-file-delete + description: Update a file in the repository. + arguments: + - name: organization_name + description: The name of the Azure DevOps organization. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: project_name + description: Project ID or project name. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: repository_id + description: The repository ID. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: branch_name + description: The branch name. This argument can be obtained by running the 'azure-devops-branch-list' command. + required: true + isArray: false + - name: commit_comment + description: Comment or message of the commit. + required: true + isArray: false + - name: file_path + description: The file path. + required: false + isArray: false + - name: entry_id + description: There is an option to the user to provide an entry_id. In that case we will take the file_content and the file_path from the given id. + required: false + isArray: false + outputs: + - type: String + contextPath: AzureDevOps.File.commits.treeId + description: Tree ID of the commit. + - type: String + contextPath: AzureDevOps.File.commits.commitId + description: ID (SHA-1) of the commit. + - type: String + contextPath: AzureDevOps.File.commits.author.name + description: Name of the commit author. + - type: String + contextPath: AzureDevOps.File.commits.author.email + description: Email address of the commit author. + - type: Date + contextPath: AzureDevOps.File.commits.author.date + description: Date of the commit operation. + - type: String + contextPath: AzureDevOps.File.commits.committer.name + description: Name of the commit committer. + - type: String + contextPath: AzureDevOps.File.commits.committer.email + description: Email address of the commit committer. + - type: Date + contextPath: AzureDevOps.File.commits.committer.date + description: Date of the commit operation. + - type: String + contextPath: AzureDevOps.File.commits.comment + description: Comment or message of the commit. + - type: String + contextPath: AzureDevOps.File.commits.parents + description: An enumeration of the parent commit IDs for this commit. + - type: String + contextPath: AzureDevOps.File.commits.url + description: REST URL for this resource. + - type: String + contextPath: AzureDevOps.File.refUpdates.repositoryId + description: The ID of the repository. + - type: String + contextPath: AzureDevOps.File.refUpdates.name + description: The branch name. + - type: String + contextPath: AzureDevOps.File.refUpdates.oldObjectId + description: The last commit ID. + - type: String + contextPath: AzureDevOps.File.refUpdates.newObjectId + description: The new commit ID. + - type: String + contextPath: AzureDevOps.File.repository.id + description: The ID of the repository. + - type: String + contextPath: AzureDevOps.File.repository.name + description: The name of the repository. + - type: String + contextPath: AzureDevOps.File.repository.url + description: The URL of the repository. + - type: String + contextPath: AzureDevOps.File.repository.project.id + description: The ID of the project. + - type: String + contextPath: AzureDevOps.File.repository.project.name + description: The name of the project. + - type: String + contextPath: AzureDevOps.File.repository.project.description + description: The description of the project. + - type: String + contextPath: AzureDevOps.File.repository.project.url + description: The URL of the project. + - type: String + contextPath: AzureDevOps.File.repository.project.state + description: The state of the project. + - type: Number + contextPath: AzureDevOps.File.repository.project.revision + description: The revision number of the project. + - type: String + contextPath: AzureDevOps.File.repository.project.visibility + description: Indicates to whom the project is visible. + - type: Date + contextPath: AzureDevOps.File.repository.project.lastUpdateTime + description: 'The project last update time, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z".' + - type: Number + contextPath: AzureDevOps.File.repository.size + description: The size of the repository (in bytes). + - type: String + contextPath: AzureDevOps.File.repository.remoteUrl + description: Remote URL path to the repository. + - type: String + contextPath: AzureDevOps.File.repository.sshUrl + description: The SSH URL of the repository. + - type: String + contextPath: AzureDevOps.File.repository.webUrl + description: The web URL of the repository. + - type: Boolean + contextPath: AzureDevOps.File.repository.isDisabled + description: If the repository is disabled or not. + - type: Boolean + contextPath: AzureDevOps.File.repository.isInMaintenance + description: If the repository is in maintenance or not. + - type: String + contextPath: AzureDevOps.File.pushedBy.displayName + description: Display name of the user who pushed the commit / file. + - type: String + contextPath: AzureDevOps.File.pushedBy.url + description: Identity reference. + - type: String + contextPath: AzureDevOps.File.pushedBy._links.avatar.href + description: URL for the user's avatar. + - type: String + contextPath: AzureDevOps.File.pushedBy.id + description: ID of the user who pushed the commit / file. + - type: String + contextPath: AzureDevOps.File.pushedBy.uniqueName + description: The unique name of the user who pushed the commit. + - type: String + contextPath: AzureDevOps.File.pushedBy.imageUrl + description: Identity image. + - type: String + contextPath: AzureDevOps.File.pushedBy.descriptor + description: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + - type: Number + contextPath: AzureDevOps.File.pushId + description: Unique ID of the push operation. + - type: Date + contextPath: AzureDevOps.File.date + description: Date of the operation. + - type: String + contextPath: AzureDevOps.File.url + description: Link to the commit. + - type: String + contextPath: AzureDevOps.File._links.self.href + description: A collection of related REST reference links. + - type: String + contextPath: AzureDevOps.File._links.repository.href + description: Link to the repository where the commit is. + - type: String + contextPath: AzureDevOps.File._links.commits.href + description: Link to the commits. + - type: String + contextPath: AzureDevOps.File._links.pusher.href + description: Link to the commit pusher. + - type: String + contextPath: AzureDevOps.File._links.refs.href + description: Link to the branch. + - name: azure-devops-file-list + description: Retrieve repository files (items) list. + arguments: + - name: organization_name + description: The name of the Azure DevOps organization. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: project_name + description: Project ID or project name. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: repository_id + description: The repository ID. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: branch_name + description: The branch name. This argument can be obtained by running the 'azure-devops-branch-list' command. + required: true + isArray: false + - auto: PREDEFINED + defaultValue: 'None' + name: recursion_level + description: The recursion level of this request. The default is None, no recursion. + required: false + isArray: false + predefined: + - 'None' + - 'OneLevel' + - 'Full' + outputs: + - type: String + contextPath: AzureDevOps.File.objectId + description: The file object ID. + - type: String + contextPath: AzureDevOps.File.gitObjectType + description: The file Git object type. + - type: String + contextPath: AzureDevOps.File.commitId + description: ID (SHA-1) of the file commit. + - type: String + contextPath: AzureDevOps.File.path + description: The file's path. + - type: Boolean + contextPath: AzureDevOps.File.isFolder + description: If the item is a folder or not. + - type: String + contextPath: AzureDevOps.File.contentMetadata.fileName + description: The file name. + - type: String + contextPath: AzureDevOps.File.url + description: URL link to the item. + - name: azure-devops-file-get + description: Getting the content file. + arguments: + - name: organization_name + description: The name of the Azure DevOps organization. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: project_name + description: Project ID or project name. A default value is taken from the configuration parameters, but the user can override it. + required: false + isArray: false + - name: repository_id + description: The repository ID. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: branch_name + description: The branch name. This argument can be obtained by running the 'azure-devops-branch-list' command. + required: true + isArray: false + - name: file_name + description: The file name. + required: true + isArray: false + - auto: PREDEFINED + predefined: + - 'json' + - 'zip' + defaultValue: 'json' + name: format + description: The file format (json or zip). + required: false + isArray: false + - name: include_content + description: Include item content. + required: false + isArray: false + auto: PREDEFINED + predefined: + - 'True' + - 'False' + defaultValue: 'True' + outputs: + - type: String + contextPath: AzureDevOps.File.objectId + description: The file object ID. + - type: String + contextPath: AzureDevOps.File.gitObjectType + description: The file Git object type. + - type: String + contextPath: AzureDevOps.File.commitId + description: ID (SHA-1) of the file commit. + - type: String + contextPath: AzureDevOps.File.path + description: The file's path. + - type: String + contextPath: AzureDevOps.File.content + description: The file content. + - name: azure-devops-branch-create + description: Create a branch. + arguments: + - name: organization_name + description: The name of the Azure DevOps organization. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: project_name + description: Project ID or project name. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: repository_id + description: The repository ID. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: branch_name + description: The branch name. + required: true + isArray: false + - name: target_ref + description: The name of the target reference. + required: true + isArray: false + - name: commit_comment + description: Comment or message of the commit. + required: true + isArray: false + - name: file_path + description: The file path. + required: false + isArray: false + - name: file_content + description: The file content. + required: false + isArray: false + - name: entry_id + description: There is an option to the user to provide an entry_id. In that case we will take the file_content and the file_path from the given id. + required: false + isArray: false + outputs: + - type: String + contextPath: AzureDevOps.Branch.commits.treeId + description: Tree ID of the commit. + - type: String + contextPath: AzureDevOps.Branch.commits.commitId + description: ID (SHA-1) of the commit. + - type: String + contextPath: AzureDevOps.Branch.commits.author.name + description: Name of the commit author. + - type: String + contextPath: AzureDevOps.Branch.commits.author.email + description: Email address of the commit author. + - type: Date + contextPath: AzureDevOps.Branch.commits.author.date + description: Date of the commit operation. + - type: String + contextPath: AzureDevOps.Branch.commits.committer.name + description: Name of the commit committer. + - type: String + contextPath: AzureDevOps.Branch.commits.committer.email + description: Email address of the commit committer. + - type: Date + contextPath: AzureDevOps.Branch.commits.committer.date + description: Date of the commit operation. + - type: String + contextPath: AzureDevOps.Branch.commits.comment + description: Comment or message of the commit. + - type: Unknown + contextPath: AzureDevOps.Branch.commits.parents + description: An enumeration of the parent commit IDs for this commit. + - type: String + contextPath: AzureDevOps.Branch.commits.url + description: REST URL for this resource. + - type: String + contextPath: AzureDevOps.Branch.refUpdates.repositoryId + description: The ID of the repository. + - type: String + contextPath: AzureDevOps.Branch.refUpdates.name + description: The branch name. + - type: String + contextPath: AzureDevOps.Branch.refUpdates.oldObjectId + description: The last commit ID. + - type: String + contextPath: AzureDevOps.Branch.refUpdates.newObjectId + description: The new commit ID. + - type: String + contextPath: AzureDevOps.Branch.repository.id + description: The ID of the repository. + - type: String + contextPath: AzureDevOps.Branch.repository.name + description: The name of the repository. + - type: String + contextPath: AzureDevOps.Branch.repository.url + description: The URL of the repository. + - type: String + contextPath: AzureDevOps.Branch.repository.project.id + description: The ID of the project. + - type: String + contextPath: AzureDevOps.Branch.repository.project.name + description: The name of the project. + - type: String + contextPath: AzureDevOps.Branch.repository.project.description + description: The description of the project. + - type: String + contextPath: AzureDevOps.Branch.repository.project.url + description: The URL of the project. + - type: String + contextPath: AzureDevOps.Branch.repository.project.state + description: The state of the project. + - type: Number + contextPath: AzureDevOps.Branch.repository.project.revision + description: The revision number of the project. + - type: String + contextPath: AzureDevOps.Branch.repository.project.visibility + description: Indicates to whom the project is visible. + - type: Date + contextPath: AzureDevOps.Branch.repository.project.lastUpdateTime + description: 'The project last update time, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z".' + - type: Number + contextPath: AzureDevOps.Branch.repository.size + description: The size of the repository (in bytes). + - type: String + contextPath: AzureDevOps.Branch.repository.remoteUrl + description: Remote URL path to the repository. + - type: String + contextPath: AzureDevOps.Branch.repository.sshUrl + description: The SSH URL of the repository. + - type: String + contextPath: AzureDevOps.Branch.repository.webUrl + description: The web URL of the repository. + - type: Boolean + contextPath: AzureDevOps.Branch.repository.isDisabled + description: If the repository is disabled or not. + - type: Boolean + contextPath: AzureDevOps.Branch.repository.isInMaintenance + description: If the repository is in maintenance or not. + - type: String + contextPath: AzureDevOps.Branch.pushedBy.displayName + description: Display name of the user who pushed the commit / file. + - type: String + contextPath: AzureDevOps.Branch.pushedBy.url + description: Identity reference. + - type: String + contextPath: AzureDevOps.Branch.pushedBy._links.avatar.href + description: URL for the user's avatar. + - type: String + contextPath: AzureDevOps.Branch.pushedBy.id + description: ID of the user who pushed the commit / file. + - type: String + contextPath: AzureDevOps.Branch.pushedBy.uniqueName + description: The unique name of the user who pushed the commit. + - type: String + contextPath: AzureDevOps.Branch.pushedBy.imageUrl + description: Identity image. + - type: String + contextPath: AzureDevOps.Branch.pushedBy.descriptor + description: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + - type: Number + contextPath: AzureDevOps.Branch.pushId + description: Unique ID of the push operation. + - type: Date + contextPath: AzureDevOps.Branch.date + description: Date of the operation. + - type: String + contextPath: AzureDevOps.Branch.url + description: Link to the commit. + - type: String + contextPath: AzureDevOps.Branch._links.self.href + description: A collection of related REST reference links. + - type: String + contextPath: AzureDevOps.Branch._links.repository.href + description: Link to the repository where the commit is. + - type: String + contextPath: AzureDevOps.Branch._links.commits.href + description: Link to the commits. + - type: String + contextPath: AzureDevOps.Branch._links.pusher.href + description: Link to the commit pusher. + - type: String + contextPath: AzureDevOps.Branch._links.refs.href + description: Link to the branch. + - name: azure-devops-pull-request-thread-create + description: Create a thread in a pull request. + arguments: + - name: organization_name + description: The name of the Azure DevOps organization. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: project_name + description: Project ID or project name. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: repository_id + description: The repository ID. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: pull_request_id + description: The ID of the pull request to update. + required: true + - name: comment_text + description: The comment content. + required: true + isArray: false + outputs: + - type: Unknown + contextPath: AzureDevOps.PullRequestThread.pullRequestThreadContext + description: Extended context information unique to pull requests. + - type: Number + contextPath: AzureDevOps.PullRequestThread.id + description: The ID of the pull request. + - type: Date + contextPath: AzureDevOps.PullRequestThread.publishedDate + description: The date the thread was published. + - type: Date + contextPath: AzureDevOps.PullRequestThread.lastUpdatedDate + description: Last update date. + - type: Number + contextPath: AzureDevOps.PullRequestThread.comments.id + description: The ID of the comments. + - type: Number + contextPath: AzureDevOps.PullRequestThread.comments.parentCommentId + description: An enumeration of the parent commit IDs for this commit. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author.displayName + description: The display name of the comments creator. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author.url + description: URL to retrieve information about this identity. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author._links.avatar.href + description: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author.id + description: The ID of the thread author. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author.uniqueName + description: The unique name of the thread author. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author.imageUrl + description: Link to the thread author user image. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author.descriptor + description: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.content + description: The comments content. + - type: Date + contextPath: AzureDevOps.PullRequestThread.comments.publishedDate + description: The date the comments were published. + - type: Date + contextPath: AzureDevOps.PullRequestThread.comments.lastUpdatedDate + description: Last update date. + - type: Date + contextPath: AzureDevOps.PullRequestThread.comments.lastContentUpdatedDate + description: The date the comment's content was last updated. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.commentType + description: The comment type at the time of creation. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments._links.self.href + description: A collection of related REST reference links. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments._links.repository.href + description: Link to the repository where the comments are. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments._links.threads.href + description: Link to the threads. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments._links.pullRequests.href + description: Link to the pull request. + - type: String + contextPath: AzureDevOps.PullRequestThread.status + description: The status of the pull request thread. + - type: Unknown + contextPath: AzureDevOps.PullRequestThread.threadContext + description: Extended context information unique to pull requests. + - type: Unknown + contextPath: AzureDevOps.PullRequestThread.properties + description: Properties associated with the thread as a collection of key-value pairs. + - type: Unknown + contextPath: AzureDevOps.PullRequestThread.identities + description: Set of identities related to this thread. + - type: Boolean + contextPath: AzureDevOps.PullRequestThread.isDeleted + description: Specify if the thread is deleted which happens when all comments are deleted. + - type: String + contextPath: AzureDevOps.PullRequestThread._links.self.href + description: Link to the thread. + - type: String + contextPath: AzureDevOps.PullRequestThread._links.repository.href + description: Link to the repository. + - name: azure-devops-pull-request-thread-update + description: Update a thread in a pull request. + arguments: + - name: organization_name + description: The name of the Azure DevOps organization. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: project_name + description: Project ID or project name. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: repository_id + description: The repository ID. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: pull_request_id + description: The ID of the pull request to update. + required: true + - name: thread_id + description: The ID of the thread to update. + required: true + - name: comment_text + description: The comment content. + required: true + isArray: false + outputs: + - type: Unknown + contextPath: AzureDevOps.PullRequestThread.pullRequestThreadContext + description: Extended context information unique to pull requests. + - type: Number + contextPath: AzureDevOps.PullRequestThread.id + description: The ID of the pull request. + - type: Date + contextPath: AzureDevOps.PullRequestThread.publishedDate + description: The date the thread was published. + - type: Date + contextPath: AzureDevOps.PullRequestThread.lastUpdatedDate + description: Last update date. + - type: Number + contextPath: AzureDevOps.PullRequestThread.comments.id + description: The ID of the comments. + - type: Number + contextPath: AzureDevOps.PullRequestThread.comments.parentCommentId + description: An enumeration of the parent commit IDs for this commit. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author.displayName + description: The display name of the comments creator. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author.url + description: URL to retrieve information about this identity. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author._links.avatar.href + description: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author.id + description: The ID of the thread author. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author.uniqueName + description: The unique name of the thread author. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author.imageUrl + description: Link to the thread author user image. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author.descriptor + description: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.content + description: The comments content. + - type: Date + contextPath: AzureDevOps.PullRequestThread.comments.publishedDate + description: The date the comments were published. + - type: Date + contextPath: AzureDevOps.PullRequestThread.comments.lastUpdatedDate + description: Last update date. + - type: Date + contextPath: AzureDevOps.PullRequestThread.comments.lastContentUpdatedDate + description: The date the comment's content was last updated. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.commentType + description: The comment type at the time of creation. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments._links.self.href + description: A collection of related REST reference links. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments._links.repository.href + description: Link to the repository where the comments are. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments._links.threads.href + description: Link to the threads. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments._links.pullRequests.href + description: Link to the pull request. + - type: String + contextPath: AzureDevOps.PullRequestThread.status + description: The status of the pull request thread. + - type: Unknown + contextPath: AzureDevOps.PullRequestThread.threadContext + description: Extended context information unique to pull requests. + - type: Unknown + contextPath: AzureDevOps.PullRequestThread.properties + description: Properties associated with the thread as a collection of key-value pairs. + - type: Unknown + contextPath: AzureDevOps.PullRequestThread.identities + description: Set of identities related to this thread. + - type: Boolean + contextPath: AzureDevOps.PullRequestThread.isDeleted + description: Specify if the thread is deleted which happens when all comments are deleted. + - type: String + contextPath: AzureDevOps.PullRequestThread._links.self.href + description: Link to the thread. + - type: String + contextPath: AzureDevOps.PullRequestThread._links.repository.href + description: Link to the repository. + - name: azure-devops-pull-request-thread-list + description: Retrieve all threads in a pull request. + arguments: + - name: organization_name + description: The name of the Azure DevOps organization. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: project_name + description: Project ID or project name. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: repository_id + description: The repository ID. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: pull_request_id + description: The ID of the pull request to update. + required: true + outputs: + - type: Unknown + contextPath: AzureDevOps.PullRequestThread.pullRequestThreadContext + description: Extended context information unique to pull requests. + - type: Number + contextPath: AzureDevOps.PullRequestThread.id + description: The ID of the pull request. + - type: Date + contextPath: AzureDevOps.PullRequestThread.publishedDate + description: The date the thread was published. + - type: Date + contextPath: AzureDevOps.PullRequestThread.lastUpdatedDate + description: Last update date. + - type: Number + contextPath: AzureDevOps.PullRequestThread.comments.id + description: The ID of the comments. + - type: Number + contextPath: AzureDevOps.PullRequestThread.comments.parentCommentId + description: An enumeration of the parent commit IDs for this commit. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author.displayName + description: The display name of the comments creator. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author.url + description: URL to retrieve information about this identity. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author._links.avatar.href + description: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author.id + description: The ID of the thread author. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author.uniqueName + description: The unique name of the thread author. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author.imageUrl + description: Link to the thread author user image. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.author.descriptor + description: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.content + description: The comments content. + - type: Date + contextPath: AzureDevOps.PullRequestThread.comments.publishedDate + description: The date the comments were published. + - type: Date + contextPath: AzureDevOps.PullRequestThread.comments.lastUpdatedDate + description: Last update date. + - type: Date + contextPath: AzureDevOps.PullRequestThread.comments.lastContentUpdatedDate + description: The date the comment's content was last updated. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments.commentType + description: The comment type at the time of creation. + - type: Unknown + contextPath: AzureDevOps.PullRequestThread.comments.usersLiked + description: A list of the users who have liked this comment. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments._links.self.href + description: A collection of related REST reference links. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments._links.repository.href + description: Link to the repository where the comments are. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments._links.threads.href + description: Link to the threads. + - type: String + contextPath: AzureDevOps.PullRequestThread.comments._links.pullRequests.href + description: Link to the pull request. + - type: Unknown + contextPath: AzureDevOps.PullRequestThread.threadContext + description: Extended context information unique to pull requests. + - type: String + contextPath: AzureDevOps.PullRequestThread.properties.CodeReviewThreadType.$type + description: The type of the code review thread. + - type: String + contextPath: AzureDevOps.PullRequestThread.properties.CodeReviewThreadType.$value + description: The content in the code review thread. + - type: String + contextPath: AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedNumAdded.$type + description: The type of the code review reviewers updated number added. + - type: Number + contextPath: AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedNumAdded.$value + description: Number of code reviewers updated the pull request. + - type: String + contextPath: AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedNumChanged.$type + description: The type of the code review reviewers updated number changed. + - type: Number + contextPath: AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedNumChanged.$value + description: Number of code reviewers changed the pull request. + - type: String + contextPath: AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedNumDeclined.$type + description: The type of the code review reviewers updated number declined. + - type: Number + contextPath: AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedNumDeclined.$value + description: Number of code reviewers declined the pull request. + - type: String + contextPath: AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedNumRemoved.$type + description: The type of the code review reviewers updated number removed. + - type: Number + contextPath: AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedNumRemoved.$value + description: Number of code reviewers are removed. + - type: String + contextPath: AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedAddedIdentity.$type + description: The type of the code review reviewers updated added identity. + - type: String + contextPath: AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedAddedIdentity.$value + description: Number of code reviewers added identity. + - type: String + contextPath: AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedByIdentity.$type + description: The type of the code review reviewers updated by identity. + - type: String + contextPath: AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedByIdentity.$value + description: Number of code reviewers updated by identity. + - type: String + contextPath: AzureDevOps.PullRequestThread.identities.1.displayName + description: The display name of the pull request thread creator. + - type: String + contextPath: AzureDevOps.PullRequestThread.identities.1.url + description: Link to the the pull request thread creator. + - type: String + contextPath: AzureDevOps.PullRequestThread.identities.1._links.avatar.href + description: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. + - type: String + contextPath: AzureDevOps.PullRequestThread.identities.1.id + description: The ID of the pull request thread creator. + - type: String + contextPath: AzureDevOps.PullRequestThread.identities.1.uniqueName + description: The user name of the pull request thread creator. + - type: String + contextPath: AzureDevOps.PullRequestThread.identities.1.imageUrl + description: Link to the pull request thread creator user image. + - type: String + contextPath: AzureDevOps.PullRequestThread.identities.1.descriptor + description: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + - type: Boolean + contextPath: AzureDevOps.PullRequestThread.isDeleted + description: Specify if the thread is deleted which happens when all comments are deleted. + - type: String + contextPath: AzureDevOps.PullRequestThread._links.self.href + description: Link to the thread. + - type: String + contextPath: AzureDevOps.PullRequestThread._links.repository.href + description: Link to the repository. + - type: String + contextPath: AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedChangedToRequired.$type + description: The type of the code review reviewers updated changed to required. + - type: String + contextPath: AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedChangedToRequired.$value + description: Number of code reviewers were changed to required. + - type: String + contextPath: AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedChangedIdentity.$type + description: The type of the code review reviewers updated changed identity. + - type: String + contextPath: AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedChangedIdentity.$value + description: Number of code reviewers changed the identity. + - type: String + contextPath: AzureDevOps.PullRequestThread.status + description: The status of the comment thread. + - type: Unknown + contextPath: AzureDevOps.PullRequestThread.properties + description: Properties associated with the thread as a collection of key-value pairs. + - type: Unknown + contextPath: AzureDevOps.PullRequestThread.identities + description: Set of identities related to this thread. + - type: String + contextPath: AzureDevOps.PullRequestThread.properties.Microsoft.TeamFoundation.Discussion.SupportsMarkdown.$type + description: The type of the supports markdown. + - type: Number + contextPath: AzureDevOps.PullRequestThread.properties.Microsoft.TeamFoundation.Discussion.SupportsMarkdown.$value + description: Supports markdown number. + - type: String + contextPath: AzureDevOps.PullRequestThread.properties.Microsoft.TeamFoundation.Discussion.UniqueID.$type + description: The type of the unique ID. + - type: String + contextPath: AzureDevOps.PullRequestThread.properties.Microsoft.TeamFoundation.Discussion.UniqueID.$value + description: The unique ID of the Team Foundation. + - name: azure-devops-project-team-list + description: Get a list of teams. + arguments: + - name: organization_name + description: The name of the Azure DevOps organization. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: project_name + description: Project ID or project name. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + outputs: + - type: String + contextPath: AzureDevOps.Team.id + description: Team (Identity) GUID. A Team Foundation ID. + - type: String + contextPath: AzureDevOps.Team.name + description: Team name. + - type: String + contextPath: AzureDevOps.Team.url + description: Team REST API URL. + - type: String + contextPath: AzureDevOps.Team.description + description: Team description. + - type: String + contextPath: AzureDevOps.Team.identityUrl + description: Identity REST API URL to this team. + - type: String + contextPath: AzureDevOps.Team.projectName + description: The project name. + - type: String + contextPath: AzureDevOps.Team.projectId + description: The project ID. + - name: azure-devops-team-member-list + description: Get a list of members for a specific team. + arguments: + - name: organization_name + description: The name of the Azure DevOps organization. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: project_name + description: Project ID or project name. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: team_id + description: The name or ID (GUID) of the team . + required: true + isArray: false + - defaultValue: '1' + description: The page number of the results to retrieve. Minimum value is 1. + name: page + - defaultValue: '50' + description: The maximum number of results to retrieve. Minimum value is 1. + name: limit + outputs: + - type: Boolean + contextPath: AzureDevOps.TeamMember.isTeamAdmin + description: Whether the member is the team admin. + - type: String + contextPath: AzureDevOps.TeamMember.identity.displayName + description: The display name of the team member. + - type: String + contextPath: AzureDevOps.TeamMember.identity.url + description: URL to retrieve information about this member. + - type: String + contextPath: AzureDevOps.TeamMember.identity._links.avatar.href + description: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. + - type: String + contextPath: AzureDevOps.TeamMember.identity.id + description: ID of the team member. + - type: String + contextPath: AzureDevOps.TeamMember.identity.uniqueName + description: The unique name of team member. + - type: String + contextPath: AzureDevOps.TeamMember.identity.imageUrl + description: Link to the team member image. + - type: String + contextPath: AzureDevOps.TeamMember.identity.descriptor + description: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. + - name: azure-devops-blob-zip-get + description: Get a single blob. + arguments: + - name: organization_name + description: The name of the Azure DevOps organization. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: project_name + description: Project ID or project name. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: repository_id + description: The repository ID. A default value is taken from the configuration parameters, but you can override it. + required: false + isArray: false + - name: file_object_id + description: The ID of the blob object. This ID can be obtained by running the 'azure-devops-file-list' command. + required: true + isArray: false + - description: Generate the login url used for Authorization code flow. name: azure-devops-generate-login-url arguments: [] - dockerimage: demisto/crypto:1.0.0.66562 + dockerimage: demisto/crypto:1.0.0.68914 isremotesyncout: true ismappable: true isfetch: true @@ -786,4 +2996,4 @@ script: type: python fromversion: 6.0.0 tests: -- playbook-AzureDevOps-Test \ No newline at end of file +- playbook-AzureDevOps-Test diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/AzureDevOps_test.py b/Packs/AzureDevOps/Integrations/AzureDevOps/AzureDevOps_test.py index aa0e2f8939cf..be5dc03b6ccb 100644 --- a/Packs/AzureDevOps/Integrations/AzureDevOps/AzureDevOps_test.py +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/AzureDevOps_test.py @@ -15,7 +15,7 @@ def load_mock_response(file_name: str) -> str: Returns: str: Mock file content. """ - with open(f'test_data/{file_name}', mode='r', encoding='utf-8') as mock_file: + with open(f'test_data/{file_name}', encoding='utf-8') as mock_file: return mock_file.read() @@ -200,7 +200,8 @@ def test_azure_devops_pull_request_create_command(requests_mock): 'target_branch': 'main', 'title': 'test-title', 'description': 'test-description', - 'reviewers_ids': '2'}) + 'reviewers_ids': '2'}, + project=project, repository=repository_id) assert len(result.outputs) == 21 assert result.outputs_prefix == 'AzureDevOps.PullRequest' @@ -286,7 +287,8 @@ def test_azure_devops_pull_request_update_command(requests_mock): 'repository_id': repository_id, 'pull_request_id': pull_request_id, 'title': 'new-title' - }) + }, + project=project, repository=repository_id) assert len(result.outputs) == 21 assert result.outputs_prefix == 'AzureDevOps.PullRequest' @@ -334,7 +336,8 @@ def test_azure_devops_pull_request_list_command(requests_mock): result = pull_requests_list_command(client, {'project': project, 'repository': repository - }) + }, + project=project, repository=repository) assert len(result.outputs) == 2 assert result.outputs_prefix == 'AzureDevOps.PullRequest' @@ -636,7 +639,7 @@ def test_azure_devops_branch_list_command(requests_mock): proxy=False, auth_type='Device Code') - result = branch_list_command(client, {"project": project, "repository": repository}) + result = branch_list_command(client, {"project": project, "repository": repository}, None, None) assert len(result.outputs) == 2 assert result.outputs_prefix == 'AzureDevOps.Branch' @@ -822,3 +825,1099 @@ def test_generate_login_url(mocker): f'&client_id={client_id}&redirect_uri={redirect_uri})' res = AzureDevOps.return_results.call_args[0][0].readable_output assert expected_url in res + + +@pytest.mark.parametrize('pull_request_id, mock_response_path', [('40', 'list_reviewers_pull_request.json')]) +def test_azure_devops_pull_request_reviewer_list_command(requests_mock, pull_request_id: str, mock_response_path: str): + """ + Given: + - pull_request_id + When: + - executing azure-devops-pull-request-reviewer-list command + Then: + - Ensure outputs_prefix and readable_output are set up right + """ + from AzureDevOps import Client, pull_request_reviewer_list_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + project = 'test' + repository = 'xsoar' + pull_request_id = pull_request_id + + url = f'https://dev.azure.com/{ORGANIZATION}/{project}/_apis/git/repositories/{repository}/' \ + f'pullRequests/{pull_request_id}/reviewers' + + mock_response = json.loads(load_mock_response(mock_response_path)) + requests_mock.get(url, json=mock_response) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + result = pull_request_reviewer_list_command(client, {'pull_request_id': pull_request_id}, ORGANIZATION, repository, project) + + assert result.outputs_prefix == 'AzureDevOps.PullRequestReviewer' + assert result.readable_output.startswith("### Reviewers List") + assert result.outputs == mock_response["value"] + + +@pytest.mark.parametrize('pull_request_id, mock_response_path', [('42', 'pull_request_not_found.json')]) +def test_azure_devops_pull_request_reviewer_list_command_pr_does_not_exist(requests_mock, pull_request_id: str, + mock_response_path: str): + """ + Given: + - pull_request_id (pr does not exist) + When: + - executing azure-devops-pull-request-reviewer-list command + Then: + - Ensure outputs_prefix and readable_output are set up right + - Ensure informative message when pull_request_id does not exist + """ + from AzureDevOps import Client, pull_request_reviewer_list_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + project = 'test' + repository = 'xsoar' + pull_request_id = pull_request_id + + url = f'https://dev.azure.com/{ORGANIZATION}/{project}/_apis/git/repositories/{repository}/' \ + f'pullRequests/{pull_request_id}/reviewers' + + mock_response = json.loads(load_mock_response(mock_response_path)) + requests_mock.get(url, json=mock_response) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + result = pull_request_reviewer_list_command(client, {'pull_request_id': pull_request_id}, ORGANIZATION, repository, project) + + assert 'The requested pull request was not found.' in result.raw_response.get("message") + assert result.outputs == "" + + +@pytest.mark.parametrize('args, organization, expected_result', + [({'organization_name': 'OVERRIDE'}, 'TEST', 'OVERRIDE'), + ({}, 'TEST', 'TEST'), + ({'organization_name': 'OVERRIDE'}, '', 'OVERRIDE')]) +def test_organization_repository_project_preprocess(args: dict, organization: str, expected_result: str): + """ + Given: + - organization as configuration parameter and as argument + When: + - executing organization_repository_project_preprocess function + Then: + - Ensure that the logic is correct + 1. The argument should override the parameter if both exist + 2. If there's only one, take it + """ + + from AzureDevOps import organization_repository_project_preprocess + + project = 'TEST' + repository = 'TEST' + + organization, repository_id, project = organization_repository_project_preprocess(args, organization, repository, project, + is_organization_required=True, + is_repository_id_required=True) + + assert organization == expected_result + + +@pytest.mark.parametrize('args, organization, expected_result', + [({}, '', 'ERROR')]) +def test_organization_repository_project_preprocess_when_no_organization(args: dict, organization: str, expected_result: str): + """ + Given: + - organization as configuration parameter and as argument + When: + - executing organization_repository_project_preprocess function + Then: + - Ensure raising an exception if organization does not exist and required + """ + + from AzureDevOps import organization_repository_project_preprocess + + project = 'TEST' + repository = 'TEST' + + with pytest.raises(Exception): + organization_repository_project_preprocess(args, organization, repository, project, + is_organization_required=True, + is_repository_id_required=True) + + +@pytest.mark.parametrize('pull_request_id, mock_response_path', + [('40', 'pull_request_reviewer_create.json')]) +def test_azure_devops_pull_request_reviewer_add_command(requests_mock, pull_request_id: str, mock_response_path: str): + """ + Given: + - all arguments + When: + - executing azure-devops-pull-request-reviewer-create command + Then: + - Ensure outputs_prefix and readable_output are set up right + """ + from AzureDevOps import Client, pull_request_reviewer_add_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + # setting parameters + project = 'test' + repository = 'xsoar' + reviewer_user_id = 'testestest6565' + + url = f'https://dev.azure.com/{ORGANIZATION}/{project}/_apis/git/repositories/{repository}/' \ + f'pullRequests/{pull_request_id}/reviewers/{reviewer_user_id}' + + mock_response = json.loads(load_mock_response(mock_response_path)) + requests_mock.put(url, json=mock_response) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + result = pull_request_reviewer_add_command(client, {'pull_request_id': pull_request_id, 'reviewer_user_id': reviewer_user_id}, + ORGANIZATION, repository, project) + + assert result.outputs_prefix == 'AzureDevOps.PullRequestReviewer' + assert result.readable_output == 'TEST (TEST) was created successfully as a reviewer for Pull Request ID 40.' + assert result.outputs == mock_response + + +@pytest.mark.parametrize('pull_request_id, mock_response_path', [('42', 'pull_request_not_found.json')]) +def test_azure_devops_pull_request_reviewer_add_command_pr_does_not_exist(requests_mock, pull_request_id: str, + mock_response_path: str): + """ + Given: + - all arguments + When: + - executing azure-devops-pull-request-reviewer-create command + Then: + - Ensure informative message when pull_request_id does not exist + """ + from AzureDevOps import Client, pull_request_reviewer_add_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + # setting parameters + project = 'test' + repository = 'xsoar' + reviewer_user_id = 'testestest6565' + + url = f'https://dev.azure.com/{ORGANIZATION}/{project}/_apis/git/repositories/{repository}/' \ + f'pullRequests/{pull_request_id}/reviewers/{reviewer_user_id}' + + mock_response = json.loads(load_mock_response(mock_response_path)) + requests_mock.put(url, json=mock_response) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + result = pull_request_reviewer_add_command(client, {'pull_request_id': pull_request_id, 'reviewer_user_id': reviewer_user_id}, + ORGANIZATION, repository, project) + + # PR does not exist + assert 'The requested pull request was not found.' in result.outputs.get("message") + assert result.outputs == {'$id': '1', 'innerException': '', 'message': 'TF401180: The requested pull request was not found.', + 'typeName': 'Microsoft.TeamFoundation.Git.Server.GitPullRequestNotFoundException,' + ' Microsoft.TeamFoundation.Git.Server', 'typeKey': 'GitPullRequestNotFoundException', + 'errorCode': 0, 'eventId': 3000, 'value': ''} + + +@pytest.mark.parametrize('pull_request_id, mock_response_path', [('40', 'pull_request_commit_list.json')]) +def test_pull_request_commit_list_command(requests_mock, pull_request_id: str, mock_response_path: str): + """ + Given: + - all arguments + When: + - executing azure-devops-pull-request-commit-list command + Then: + - Ensure outputs_prefix and readable_output are set up right + """ + from AzureDevOps import Client, pull_request_commit_list_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + # setting parameters + project = 'test' + repository = 'xsoar' + + url = f'https://dev.azure.com/{ORGANIZATION}/{project}/_apis/git/repositories/{repository}/' \ + f'pullRequests/{pull_request_id}/commits' + + mock_response = json.loads(load_mock_response(mock_response_path)) + requests_mock.get(url, json=mock_response) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + result = pull_request_commit_list_command(client, {'pull_request_id': pull_request_id, 'limit': '1'}, + ORGANIZATION, repository, project) + + assert result.readable_output.startswith('### Commits') + assert result.outputs_prefix == 'AzureDevOps.Commit' + assert result.outputs == mock_response["value"] + + +@pytest.mark.parametrize('pull_request_id, mock_response_path', [('42', 'pull_request_not_found.json')]) +def test_pull_request_commit_list_command_pr_does_not_exist(requests_mock, pull_request_id: str, mock_response_path: str): + """ + Given: + - all arguments + When: + - executing azure-devops-pull-request-commit-list command + Then: + - Ensure informative message when pull_request_id does not exist + """ + from AzureDevOps import Client, pull_request_commit_list_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + # setting parameters + project = 'test' + repository = 'xsoar' + + url = f'https://dev.azure.com/{ORGANIZATION}/{project}/_apis/git/repositories/{repository}/' \ + f'pullRequests/{pull_request_id}/commits' + + mock_response = json.loads(load_mock_response(mock_response_path)) + requests_mock.get(url, json=mock_response) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + result = pull_request_commit_list_command(client, {'pull_request_id': pull_request_id, 'limit': '1'}, + ORGANIZATION, repository, project) + # PR does not exist + assert 'The requested pull request was not found.' in result.raw_response.get("message") + assert result.outputs == "" + + +@pytest.mark.parametrize('args, expected_limit, expected_offset', + [({}, 50, 0), + ({'limit': '2'}, 2, 0), + ({'page': '2'}, 50, 50), + ({'limit': '2', 'page': '2'}, 2, 2)]) +def test_pagination_preprocess_and_validation(args: dict, expected_limit: int, expected_offset: int): + from AzureDevOps import pagination_preprocess_and_validation + + limit, offset = pagination_preprocess_and_validation(args) + + assert limit == expected_limit + assert offset == expected_offset + + +def test_commit_list_command(requests_mock): + """ + Given: + - all arguments, limit = 1 + When: + - executing azure-devops-commit-list command + Then: + - Ensure outputs_prefix and readable_output are set up right + """ + from AzureDevOps import Client, commit_list_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + # setting parameters + project = 'test' + repository = 'xsoar' + + url = f'https://dev.azure.com/{ORGANIZATION}/{project}/_apis/git/repositories/{repository}/commits' + + mock_response = json.loads(load_mock_response('commit_list.json')) + requests_mock.get(url, json=mock_response) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + result = commit_list_command(client, {'limit': '1'}, ORGANIZATION, repository, project) + + assert result.readable_output.startswith('### Commits') + assert result.outputs_prefix == 'AzureDevOps.Commit' + assert result.outputs == mock_response["value"] + + +def test_commit_get_command(requests_mock): + """ + Given: + - all arguments include commit_id (required) + When: + - executing azure-devops-commit-get command + Then: + - Ensure outputs_prefix and readable_output are set up right + """ + from AzureDevOps import Client, commit_get_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + # setting parameters + project = 'test' + repository = 'xsoar' + commit_id = 'xxxxxxxxxxxxx' + + url = f'https://dev.azure.com/{ORGANIZATION}/{project}/_apis/git/repositories/{repository}/commits/{commit_id}' + + mock_response = json.loads(load_mock_response('commit_list.json')) + requests_mock.get(url, json=mock_response) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + result = commit_get_command(client, {'commit_id': 'xxxxxxxxxxxxx'}, ORGANIZATION, repository, project) + + assert result.readable_output.startswith('### Commit Details') + assert result.outputs_prefix == 'AzureDevOps.Commit' + assert result.outputs == mock_response + + +def test_work_item_get_command(requests_mock): + """ + Given: + - all arguments include item_id (required) + When: + - executing azure-devops-work-item-get command + Then: + - Ensure outputs_prefix and readable_output are set up right + """ + from AzureDevOps import Client, work_item_get_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + # setting parameters + project = 'test' + repository = 'xsoar' + item_id = '12' + + url = f'https://dev.azure.com/{ORGANIZATION}/{project}/_apis/wit/workitems/{item_id}' + + mock_response = json.loads(load_mock_response('work_item_get.json')) + requests_mock.get(url, json=mock_response) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + result = work_item_get_command(client, {'item_id': '12'}, ORGANIZATION, repository, project) + + assert result.readable_output.startswith('### Work Item Details\n|Activity Date|Area Path|Assigned To|ID|State|Tags|Title|\n') + assert result.outputs_prefix == 'AzureDevOps.WorkItem' + assert result.outputs == mock_response + + +def test_work_item_create_command(requests_mock): + """ + Given: + - type and title arguments (required) + When: + - executing azure-devops-work-item-create command + Then: + - Ensure outputs_prefix and readable_output are set up right + """ + from AzureDevOps import Client, work_item_create_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + # setting parameters + project = 'test' + repository = 'xsoar' + work_item_type = "Epic" + + url = f'https://dev.azure.com/{ORGANIZATION}/{project}/_apis/wit/workitems/${work_item_type}' + + mock_response = json.loads(load_mock_response('work_item_create.json')) + requests_mock.post(url, json=mock_response) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + result = work_item_create_command(client, {"type": "Epic", "title": "Test"}, ORGANIZATION, repository, project) + + assert result.readable_output.startswith(f'Work Item {result.outputs.get("id")} was created successfully.') + assert result.outputs_prefix == 'AzureDevOps.WorkItem' + assert result.outputs == mock_response + + +def test_work_item_update_command(requests_mock): + """ + Given: + - item_id (required) and title + When: + - executing azure-devops-work-item-update command + Then: + - Ensure outputs_prefix and readable_output are set up right + """ + from AzureDevOps import Client, work_item_update_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + # setting parameters + project = 'test' + repository = 'xsoar' + item_id = "21" + + url = f'https://dev.azure.com/{ORGANIZATION}/{project}/_apis/wit/workitems/{item_id}' + + mock_response = json.loads(load_mock_response('work_item_update.json')) + requests_mock.patch(url, json=mock_response) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + result = work_item_update_command(client, {"item_id": "21", "title": "Test"}, ORGANIZATION, repository, project) + + assert result.readable_output.startswith('Work Item 21 was updated successfully.') + assert result.outputs_prefix == 'AzureDevOps.WorkItem' + assert result.outputs == mock_response + + +EXPECTED_RESULT = [{'op': 'add', 'path': '/fields/System.Title', 'from': None, 'value': 'zzz'}, + {'op': 'add', 'path': '/fields/System.IterationPath', 'from': None, 'value': 'test'}, + {'op': 'add', 'path': '/fields/System.Description', 'from': None, 'value': 'test'}, + {'op': 'add', 'path': '/fields/Microsoft.VSTS.Common.Priority', 'from': None, 'value': '4'}, + {'op': 'add', 'path': '/fields/System.Tags', 'from': None, 'value': 'test'}] +ARGUMENTS_LIST = ['title', 'iteration_path', 'description', 'priority', 'tag'] +ARGS = {"title": "zzz", "iteration_path": "test", "description": "test", "priority": "4", "tag": "test"} + + +@pytest.mark.parametrize('args, arguments_list, expected_result', + [(ARGS, ARGUMENTS_LIST, EXPECTED_RESULT)]) +def test_work_item_pre_process_data(args: dict, arguments_list: list[str], expected_result: dict): + """ + Ensure work_item_pre_process_data function generates the data (body) for the request as expected. + """ + from AzureDevOps import work_item_pre_process_data + data = work_item_pre_process_data(args, arguments_list) + assert data == expected_result + + +def test_file_create_command(requests_mock): + """ + Given: + - all required arguments + When: + - executing azure-devops-file-create command + Then: + - Ensure outputs_prefix and readable_output are set up right + """ + from AzureDevOps import Client, file_create_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + # setting parameters + project = 'test' + repository = 'xsoar' + + url_1 = f'https://dev.azure.com/{ORGANIZATION}/{project}/_apis/git/repositories/{repository}/pushes' + + mock_response_1 = json.loads(load_mock_response('file.json')) + requests_mock.post(url_1, json=mock_response_1) + + url_2 = f'{BASE_URL}/{project}/_apis/git/repositories/{repository}/refs' + + mock_response_2 = json.loads(load_mock_response('branch_list.json')) + requests_mock.get(url_2, json=mock_response_2) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + args = {"branch_id": "111", + "branch_name": "refs/heads/main", + "commit_comment": "Test 5.", + "file_content": "# Tasks\\n\\n* Item 1\\n* Item 2", + "file_path": "/test_5.md" + } + result = file_create_command(client, args, ORGANIZATION, repository, project) + + assert result.readable_output.startswith( + 'Commit "Test 5." was created and pushed successfully by "" to branch "refs/heads/main".') + assert result.outputs_prefix == 'AzureDevOps.File' + assert result.outputs == mock_response_1 + + +CREATE_FILE_CHANGE_TYPE = "add" +CREATE_FILE_ARGS = {"branch_id": "111", + "branch_name": "Test", + "commit_comment": "Test 6", + "file_content": "# Tasks\\n\\n* Item 1\\n* Item 2", + "file_path": "/test_5.md" + } +CREATE_FILE_EXPECTED_RESULT = {'refUpdates': [{'name': 'Test', 'oldObjectId': '111'}], + 'commits': [{'comment': 'Test 6', 'changes': [{'changeType': 'add', 'item': {'path': '/test_5.md'}, + 'newContent': + {'content': '# Tasks\\n\\n* Item 1\\n* Item 2', + 'contentType': 'rawtext'}}]}]} +CREATE_FILE = (CREATE_FILE_CHANGE_TYPE, CREATE_FILE_ARGS, CREATE_FILE_EXPECTED_RESULT) + +UPDATE_FILE_CHANGE_TYPE = "edit" +UPDATE_FILE_ARGS = {"branch_id": "111", + "branch_name": "Test", + "commit_comment": "Test 6", + "file_content": "UPDATE", + "file_path": "/test_5.md" + } +UPDATE_FILE_EXPECTED_RESULT = {'refUpdates': [{'name': 'Test', 'oldObjectId': '111'}], + 'commits': [{'comment': 'Test 6', 'changes': [{'changeType': 'edit', 'item': + {'path': '/test_5.md'}, + 'newContent': {'content': 'UPDATE', 'contentType': 'rawtext'}}]}]} +UPDATE_FILE = (UPDATE_FILE_CHANGE_TYPE, UPDATE_FILE_ARGS, UPDATE_FILE_EXPECTED_RESULT) + +DELETE_FILE_CHANGE_TYPE = "delete" +DELETE_FILE_ARGS = {"branch_id": "111", + "branch_name": "Test", + "commit_comment": "Test 6", + "file_path": "/test_5.md" + } +DELETE_FILE_EXPECTED_RESULT = {'refUpdates': [{'name': 'Test', 'oldObjectId': '111'}], + 'commits': [{'comment': 'Test 6', + 'changes': [{'changeType': 'delete', 'item': {'path': '/test_5.md'}}]}]} +DELETE_FILE = (DELETE_FILE_CHANGE_TYPE, DELETE_FILE_ARGS, DELETE_FILE_EXPECTED_RESULT) + + +@pytest.mark.parametrize('change_type, args, expected_result', + [CREATE_FILE, UPDATE_FILE, DELETE_FILE]) +def test_file_pre_process_body_request(requests_mock, change_type: str, args: dict, expected_result: dict): + """ + Given: + - all required arguments + When: + - executing file_pre_process_body_request static method + Then: + - Ensure that this static method works as expected by constructing the HTTP response data accordingly. + """ + from AzureDevOps import Client, file_pre_process_body_request + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + data = file_pre_process_body_request(change_type, args) + assert data == expected_result + + +def test_file_update_command(requests_mock): + """ + Given: + - all required arguments + When: + - executing azure-devops-file-update command + Then: + - Ensure outputs_prefix and readable_output are set up right + """ + from AzureDevOps import Client, file_update_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + # setting parameters + project = 'test' + repository = 'xsoar' + + url_1 = f'https://dev.azure.com/{ORGANIZATION}/{project}/_apis/git/repositories/{repository}/pushes' + + mock_response_1 = json.loads(load_mock_response('file.json')) + requests_mock.post(url_1, json=mock_response_1) + + url_2 = f'{BASE_URL}/{project}/_apis/git/repositories/{repository}/refs' + + mock_response_2 = json.loads(load_mock_response('branch_list.json')) + requests_mock.get(url_2, json=mock_response_2) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + args = {"branch_id": "111", + "branch_name": "refs/heads/main", + "commit_comment": "Test 5.", + "file_content": "UPTADE", + "file_path": "/test_5.md" + } + result = file_update_command(client, args, ORGANIZATION, repository, project) + + assert result.readable_output.startswith('Commit "Test 5." was updated successfully by "" in branch "refs/heads/main".') + assert result.outputs_prefix == 'AzureDevOps.File' + assert result.outputs == mock_response_1 + + +def test_file_delete_command(requests_mock): + """ + Given: + - all required arguments + When: + - executing azure-devops-file-delete command + Then: + - Ensure outputs_prefix and readable_output are set up right + """ + from AzureDevOps import Client, file_delete_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + # setting parameters + project = 'test' + repository = 'xsoar' + + url_1 = f'https://dev.azure.com/{ORGANIZATION}/{project}/_apis/git/repositories/{repository}/pushes' + + mock_response_1 = json.loads(load_mock_response('file.json')) + requests_mock.post(url_1, json=mock_response_1) + + url_2 = f'{BASE_URL}/{project}/_apis/git/repositories/{repository}/refs' + + mock_response_2 = json.loads(load_mock_response('branch_list.json')) + requests_mock.get(url_2, json=mock_response_2) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + args = {"branch_id": "111", + "branch_name": "refs/heads/main", + "commit_comment": "Test 5.", + "file_path": "/test_5.md" + } + result = file_delete_command(client, args, ORGANIZATION, repository, project) + + assert result.readable_output.startswith('Commit "Test 5." was deleted successfully by "" in branch "refs/heads/main".') + assert result.outputs_prefix == 'AzureDevOps.File' + assert result.outputs == mock_response_1 + + +def test_file_list_command(requests_mock): + """ + Given: + - all required arguments + When: + - executing azure-devops-file-list command + Then: + - Ensure outputs_prefix and readable_output are set up right + """ + from AzureDevOps import Client, file_list_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + # setting parameters + project = 'test' + repository = 'xsoar' + + url_1 = f'https://dev.azure.com/{ORGANIZATION}/{project}/_apis/git/repositories/{repository}/items' + + mock_response_1 = json.loads(load_mock_response('file_list.json')) + requests_mock.get(url_1, json=mock_response_1) + + url_2 = f'{BASE_URL}/{project}/_apis/git/repositories/{repository}/refs' + + mock_response_2 = json.loads(load_mock_response('branch_list.json')) + requests_mock.get(url_2, json=mock_response_2) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + args = {"branch_name": "refs/heads/main", + "recursion_level": "OneLevel", + } + result = file_list_command(client, args, ORGANIZATION, repository, project) + + assert result.readable_output.startswith('### Files\n|File Name(s)|Object ID|Commit ID|Object Type|Is Folder|\n') + assert result.outputs_prefix == 'AzureDevOps.File' + assert result.outputs == mock_response_1["value"] + + +ZIP = ("zip", {"Content-Type": "application/zip"}, "response") +JSON = ("json", {"Content-Type": "application/json"}, "json") + + +@pytest.mark.parametrize('format_file, headers, resp_type', [ZIP, JSON]) +def test_file_get_command(mocker, requests_mock, format_file: str, headers: dict, resp_type: str): + """ + Given: + - all required arguments + When: + - executing azure-devops-file-get command + Then: + - Ensure headers and resp_type were sent correctly based on input (json or zip). + """ + from AzureDevOps import Client, file_get_command + from requests import Response + import AzureDevOps + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + response = Response() + + http_request = mocker.patch.object(client.ms_client, 'http_request', + return_value=response if format_file == 'zip' else {"content": ""}) + + args = {"file_name": "test_file", "branch_name": "Test", "format": format_file, "include_content": False} + + mocker.patch.object(AzureDevOps, 'fileResult') + file_get_command(client, args, ORGANIZATION, "test", "test") + + assert http_request.call_args.kwargs["headers"] == headers + assert http_request.call_args.kwargs["resp_type"] == resp_type + + +def test_branch_create_command(requests_mock): + """ + Given: + - all required arguments + When: + - executing azure-devops-branch-create command + Then: + - Ensure outputs_prefix and readable_output are set up right + """ + from AzureDevOps import Client, branch_create_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + # setting parameters + project = 'test' + repository = 'xsoar' + + url_1 = f'https://dev.azure.com/{ORGANIZATION}/{project}/_apis/git/repositories/{repository}/pushes' + + mock_response_1 = json.loads(load_mock_response('branch_create.json')) + requests_mock.post(url_1, json=mock_response_1) + + url_2 = f'{BASE_URL}/{project}/_apis/git/repositories/{repository}/refs' + + mock_response_2 = json.loads(load_mock_response('branch_list.json')) + requests_mock.get(url_2, json=mock_response_2) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + args = {"branch_name": "refs/heads/main", + "file_path": "Test", + "commit_comment": "Initial commit", + } + result = branch_create_command(client, args, ORGANIZATION, repository, project) + + assert result.readable_output.startswith('Branch refs/heads/main was created successfully by XXXXXX.') + assert result.outputs_prefix == 'AzureDevOps.Branch' + assert result.outputs == mock_response_1 + + +def test_pull_request_thread_create_command(requests_mock): + """ + Given: + - all required arguments + When: + - executing azure-devops-pull-request-thread-create command + Then: + - Ensure outputs_prefix and readable_output are set up right + """ + from AzureDevOps import Client, pull_request_thread_create_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + # setting parameters + project = 'test' + repository = 'xsoar' + pull_request_id = 43 + + url = f'https://dev.azure.com/{ORGANIZATION}/{project}/_apis/git/repositories/{repository}/pullRequests/' \ + f'{pull_request_id}/threads' + + mock_response = json.loads(load_mock_response('pull_request_thread_create.json')) + requests_mock.post(url, json=mock_response) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + args = {"pull_request_id": 43, "comment_text": "Test"} + result = pull_request_thread_create_command(client, args, ORGANIZATION, repository, project) + + assert result.readable_output.startswith('Thread 65 was created successfully by XXXXXX.') + assert result.outputs_prefix == 'AzureDevOps.PullRequestThread' + assert result.outputs == mock_response + + +def test_pull_request_thread_update_command(requests_mock): + """ + Given: + - all required arguments + When: + - executing azure-devops-pull-request-thread-update command + Then: + - Ensure outputs_prefix and readable_output are set up right + """ + from AzureDevOps import Client, pull_request_thread_update_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + # setting parameters + project = 'test' + repository = 'xsoar' + pull_request_id = 43 + thread_id = 66 + + url = f'https://dev.azure.com/{ORGANIZATION}/{project}/_apis/git/repositories/{repository}/pullRequests/' \ + f'{pull_request_id}/threads/{thread_id}' + + mock_response = json.loads(load_mock_response('pull_request_thread_update.json')) + requests_mock.patch(url, json=mock_response) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + args = {"pull_request_id": 43, "thread_id": 66, "comment_text": "Test"} + result = pull_request_thread_update_command(client, args, ORGANIZATION, repository, project) + + assert result.readable_output.startswith('Thread 66 was updated successfully by XXXXXXX.') + assert result.outputs_prefix == 'AzureDevOps.PullRequestThread' + assert result.outputs == mock_response + + +def test_pull_request_thread_list_command(requests_mock): + """ + Given: + - all required arguments + When: + - executing azure-devops-pull-request-thread-list command + Then: + - Ensure outputs_prefix and readable_output are set up right + - Ensure nested threads are displayed as expected. (meaning updates should be displayed in the readable_output too) + """ + from AzureDevOps import Client, pull_request_thread_list_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + # setting parameters + project = 'test' + repository = 'xsoar' + pull_request_id = 43 + + url = f'https://dev.azure.com/{ORGANIZATION}/{project}/_apis/git/repositories/{repository}/pullRequests/' \ + f'{pull_request_id}/threads' + + mock_response = json.loads(load_mock_response('pull_request_thread_list.json')) + requests_mock.get(url, json=mock_response) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + args = {"pull_request_id": 43} + result = pull_request_thread_list_command(client, args, ORGANIZATION, repository, project) + + assert result.readable_output.startswith('### Threads\n|Thread ID|Content|Name|Date|\n|---|---|---|---|\n| 66 | 123 | XXX |' + ' 2023-07-23T20:08:57.74Z |\n| 66 | 111 | XXX | 2023-07-23T20:11:30.633Z |') + assert result.outputs_prefix == 'AzureDevOps.PullRequestThread' + assert result.outputs == mock_response["value"] + + +def test_project_team_list_command(requests_mock): + """ + Given: + - all required arguments + When: + - executing azure-devops-project-team-list command + Then: + - Ensure outputs_prefix and readable_output are set up right + """ + from AzureDevOps import Client, project_team_list_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + # setting parameters + project = 'test' + + url = f'https://dev.azure.com/{ORGANIZATION}/_apis/projects/{project}/teams' + + mock_response = json.loads(load_mock_response('project_team_list.json')) + requests_mock.get(url, json=mock_response) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + result = project_team_list_command(client, {}, ORGANIZATION, project) + + assert result.readable_output.startswith('### Teams\n|Name|\n|---|\n| DevOpsDemo Team |\n') + assert result.outputs_prefix == 'AzureDevOps.Team' + assert result.outputs == mock_response["value"] + + +def test_team_member_list_command(requests_mock): + """ + Given: + - all required arguments + When: + - executing azure-devops-team-member-list command + Then: + - Ensure outputs_prefix and readable_output are set up right + """ + from AzureDevOps import Client, team_member_list_command + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + # setting parameters + project = 'test' + team_id = "zzz" + + url = f'https://dev.azure.com/{ORGANIZATION}/_apis/projects/{project}/teams/{team_id}/members' + + mock_response = json.loads(load_mock_response('team_member_list.json')) + requests_mock.get(url, json=mock_response) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + result = team_member_list_command(client, {"team_id": "zzz"}, ORGANIZATION, project) + + assert result.readable_output.startswith( + '### Team Members\n|Name|Unique Name|User ID|\n|---|---|---|\n| XXX | | |\n| YYY | | |') + assert result.outputs_prefix == 'AzureDevOps.TeamMember' + assert result.outputs == mock_response["value"] + + +def test_blob_zip_get_command(mocker, requests_mock): + """ + Given: + - all required arguments + When: + - executing azure-devops-blob-zip-get command + Then: + - Ensure the output's type is INFO_FILE + """ + import AzureDevOps + from AzureDevOps import Client, blob_zip_get_command + from requests import Response + + authorization_url = 'https://login.microsoftonline.com/organizations/oauth2/v2.0/token' + requests_mock.post(authorization_url, json=get_azure_access_token_mock()) + + client = Client( + client_id=CLIENT_ID, + organization=ORGANIZATION, + verify=False, + proxy=False, + auth_type='Device Code') + + with open('test_data/response_content') as content: + response = Response() + response._content = content + + mocker.patch.object(client.ms_client, 'http_request', return_value=response) + + args = {'file_object_id': 'zzz'} + + mocker.patch.object(AzureDevOps, 'fileResult', return_value={'Type': EntryType.ENTRY_INFO_FILE}) + res = blob_zip_get_command(client, args, ORGANIZATION, "test", "test") + + assert res['Type'] == EntryType.ENTRY_INFO_FILE diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/README.md b/Packs/AzureDevOps/Integrations/AzureDevOps/README.md index b2d2e3714783..9394115c545c 100644 --- a/Packs/AzureDevOps/Integrations/AzureDevOps/README.md +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/README.md @@ -1655,6 +1655,1049 @@ Retrieve repository branches list. >|---| >| refs/heads/main | + +### azure-devops-pull-request-reviewer-list + +*** +Retrieve the reviewers for a pull request. + +#### Base Command + +`azure-devops-pull-request-reviewer-list` + +#### Input + +| **Argument Name** | **Description** | **Required** | +| --- | --- | --- | +| organization_name | The name of the Azure DevOps organization. Default value will be config param, user can supply a different value. | Optional | +| project_name | Project ID or project name. Default value will be config param, user can supply a different value. | Optional | +| repository_id | The repository ID. Default value will be config param, user can supply a different value. | Optional | +| pull_request_id | ID of the pull request. By using the azure-devops-pull-request-list command, you can obtain the ID. | Required | + +#### Context Output + +| **Path** | **Type** | **Description** | +| --- | --- | --- | +| AzureDevOps.PullRequestReviewer.reviewerUrl | String | URL to retrieve information about this identity. | +| AzureDevOps.PullRequestReviewer.vote | Number | Vote on a pull request, 10 - approved, 5 - approved with suggestions, 0 - no vote, -5 - waiting for author, -10 - rejected. | +| AzureDevOps.PullRequestReviewer.hasDeclined | Boolean | Whether the pull request has been declined. | +| AzureDevOps.PullRequestReviewer.isRequired | Boolean | Indicates if this is a required reviewer for this pull request. Branches can have policies that require particular reviewers are required for pull requests. | +| AzureDevOps.PullRequestReviewer.isFlagged | Boolean | A way to mark some special Pull Requests we are dealing with to distinguish them from other Pull Requests. | +| AzureDevOps.PullRequestReviewer.displayName | String | This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. | +| AzureDevOps.PullRequestReviewer.url | String | REST URL for this resource. | +| AzureDevOps.PullRequestReviewer._links.avatar.href | String | This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. | +| AzureDevOps.PullRequestReviewer.id | String | Pull-request reviewers IDs. | +| AzureDevOps.PullRequestReviewer.uniqueName | String | The reviewers user name. | +| AzureDevOps.PullRequestReviewer.imageUrl | String | Link to the reviewers user image. | + +### azure-devops-pull-request-reviewer-add + +*** +Add a reviewer to a pull request. + +#### Base Command + +`azure-devops-pull-request-reviewer-add` + +#### Input + +| **Argument Name** | **Description** | **Required** | +| --- | --- | --- | +| organization_name | The name of the Azure DevOps organization. Default value will be config param, user can supply a different value. | Optional | +| repository_id | The repository ID. Default value will be config param, user can supply a different value. | Optional | +| project_name | Project ID or project name. Default value will be config param, user can supply a different value. | Optional | +| reviewer_user_id | ID of the reviewer. By using the azure-devops-user-list command, you can obtain the user ID. | Required | +| is_required | Indicates if this is a required reviewer for this pull request. Branches can have policies that require particular reviewers are required for pull requests. Possible values are: True, False. | Optional | +| pull_request_id | ID of the pull request. | Required | + +#### Context Output + +| **Path** | **Type** | **Description** | +| --- | --- | --- | +| AzureDevOps.PullRequestReviewer.reviewerUrl | String | URL to retrieve information about this identity. | +| AzureDevOps.PullRequestReviewer.vote | Number | Vote on a pull request, 10 - approved, 5 - approved with suggestions, 0 - no vote, -5 - waiting for author, -10 - rejected. | +| AzureDevOps.PullRequestReviewer.hasDeclined | Boolean | Whether the pull request has been declined. | +| AzureDevOps.PullRequestReviewer.isFlagged | Boolean | A way to mark some special Pull Requests we are dealing with to distinguish them from other Pull Requests. | +| AzureDevOps.PullRequestReviewer._links.avatar.href | String | This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. | +| AzureDevOps.PullRequestReviewer.id | String | Pull-request reviewers IDs. | +| AzureDevOps.PullRequestReviewer.displayName | String | This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. | +| AzureDevOps.PullRequestReviewer.uniqueName | String | The reviewers user name. | +| AzureDevOps.PullRequestReviewer.url | String | REST URL for this resource. | +| AzureDevOps.PullRequestReviewer.imageUrl | String | Link to the reviewers user image. | + +### azure-devops-pull-request-commit-list + +*** +Get the commits for the specified pull request. + +#### Base Command + +`azure-devops-pull-request-commit-list` + +#### Input + +| **Argument Name** | **Description** | **Required** | +| --- | --- | --- | +| organization_name | The name of the Azure DevOps organization. Default value will be config param, user can supply a different value. | Optional | +| project_name | Project ID or project name. Default value will be config param, user can supply a different value. | Optional | +| repository_id | The repository ID. Default value will be config param, user can supply a different value. | Optional | +| pull_request_id | ID of the pull request. By using the azure-devops-pull-request-list command, you can obtain the ID. | Required | +| limit | The number of results to retrieve. Minimum value is 1. Default is 50. | Optional | + +#### Context Output + +| **Path** | **Type** | **Description** | +| --- | --- | --- | +| AzureDevOps.Commit.commitId | String | ID \(SHA-1\) of the commit. | +| AzureDevOps.Commit.author.name | String | Name of the commit author. | +| AzureDevOps.Commit.author.email | String | Email address of the commit author. | +| AzureDevOps.Commit.author.date | Date | Date of the commit operation. | +| AzureDevOps.Commit.committer.name | String | Name of the commit committer. | +| AzureDevOps.Commit.committer.email | String | Email address of the commit committer. | +| AzureDevOps.Commit.committer.date | Date | Date of the commit operation. | +| AzureDevOps.Commit.comment | String | Comment or message of the commit. | +| AzureDevOps.Commit.url | String | REST URL for this resource. | + +### azure-devops-commit-list + +*** +Retrieve git commits for a project. + +#### Base Command + +`azure-devops-commit-list` + +#### Input + +| **Argument Name** | **Description** | **Required** | +| --- | --- | --- | +| organization_name | The name of the Azure DevOps organization. Default value will be config param, user can supply a different value. | Optional | +| project_name | Project ID or project name. Default value will be config param, user can supply a different value. | Optional | +| repository_id | The repository ID. Default value will be config param, user can supply a different value. | Optional | +| limit | The number of results to retrieve. Minimum value is 1. Default is 50. | Optional | +| page | The page number of the results to retrieve. Minimum value is 1. Default is 1. | Optional | + +#### Context Output + +| **Path** | **Type** | **Description** | +| --- | --- | --- | +| AzureDevOps.Commit.commitId | String | ID \(SHA-1\) of the commit. | +| AzureDevOps.Commit.author.name | String | Name of the commit author. | +| AzureDevOps.Commit.author.email | String | Email address of the commit author. | +| AzureDevOps.Commit.author.date | Date | Date of the commit operation. | +| AzureDevOps.Commit.committer.name | String | Name of the commit committer. | +| AzureDevOps.Commit.committer.email | String | Email address of the commit committer. | +| AzureDevOps.Commit.committer.date | Date | Date of the commit operation. | +| AzureDevOps.Commit.comment | String | Comment or message of the commit. | +| AzureDevOps.Commit.changeCounts | Number | Counts of the types of changes \(edits, deletes, etc.\) included with the commit. | +| AzureDevOps.Commit.url | String | REST URL for this resource. | +| AzureDevOps.Commit.remoteUrl | String | Remote URL path to the commit. | + +### azure-devops-commit-get + +*** +Retrieve a particular commit. + +#### Base Command + +`azure-devops-commit-get` + +#### Input + +| **Argument Name** | **Description** | **Required** | +| --- | --- | --- | +| organization_name | The name of the Azure DevOps organization. Default value will be config param, user can supply a different value. | Optional | +| project_name | Project ID or project name. Default value will be config param, user can supply a different value. | Optional | +| repository_id | The repository ID. Default value will be config param, user can supply a different value. | Optional | +| commit_id | The id of the commit. | Required | + +#### Context Output + +| **Path** | **Type** | **Description** | +| --- | --- | --- | +| AzureDevOps.Commit.treeId | String | Tree ID of the commit. | +| AzureDevOps.Commit.commitId | String | ID \(SHA-1\) of the commit. | +| AzureDevOps.Commit.author.name | String | Name of the commit author. | +| AzureDevOps.Commit.author.email | String | Email address of the commit author. | +| AzureDevOps.Commit.author.date | Date | Date of the commit operation. | +| AzureDevOps.Commit.author.imageUrl | String | Link to the author user image. | +| AzureDevOps.Commit.committer.name | String | Name of the commit committer. | +| AzureDevOps.Commit.committer.email | String | Email address of the commit committer. | +| AzureDevOps.Commit.committer.date | Date | Date of the commit operation. | +| AzureDevOps.Commit.committer.imageUrl | String | Link to the committer user image. | +| AzureDevOps.Commit.comment | String | Comment or message of the commit. | +| AzureDevOps.Commit.parents | String | An enumeration of the parent commit IDs for this commit. | +| AzureDevOps.Commit.url | String | REST URL for this resource. | +| AzureDevOps.Commit.remoteUrl | String | Remote URL path to the commit. | +| AzureDevOps.Commit._links.self.href | String | A collection of related REST reference links. | +| AzureDevOps.Commit._links.repository.href | String | Link to the repository where the commit is. | +| AzureDevOps.Commit._links.web.href | String | Link to the commit. | +| AzureDevOps.Commit._links.changes.href | String | Link to the commit changes. | +| AzureDevOps.Commit.push.pushedBy.displayName | String | Display name of the user who pushed the commit. | +| AzureDevOps.Commit.push.pushedBy.url | String | Identity Reference. | +| AzureDevOps.Commit.push.pushedBy._links.avatar.href | String | Url for the user's avatar. | +| AzureDevOps.Commit.push.pushedBy.id | String | ID of the user who pushed the commit. | +| AzureDevOps.Commit.push.pushedBy.uniqueName | String | Domain and principal name. | +| AzureDevOps.Commit.push.pushedBy.imageUrl | String | Identity Image. | +| AzureDevOps.Commit.push.pushedBy.descriptor | String | The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. | +| AzureDevOps.Commit.push.pushId | Number | Unique ID of the push operation. | +| AzureDevOps.Commit.push.date | Date | Date of the push operation. | + +### azure-devops-work-item-get + +*** +Returns a single work item. + +#### Base Command + +`azure-devops-work-item-get` + +#### Input + +| **Argument Name** | **Description** | **Required** | +| --- | --- | --- | +| organization_name | The name of the Azure DevOps organization. Default value will be config param, user can supply a different value. | Optional | +| project_name | Project ID or project name. Default value will be config param, user can supply a different value. | Optional | +| item_id | The work item id. | Required | + +#### Context Output + +| **Path** | **Type** | **Description** | +| --- | --- | --- | +| AzureDevOps.WorkItem.id | Number | The work item ID. | +| AzureDevOps.WorkItem.rev | Number | Revision number of the work item. | +| AzureDevOps.WorkItem.fields.System.AreaPath | String | The work item AreaPath. Area paths allow you to group work items by team, product, or feature area. | +| AzureDevOps.WorkItem.fields.System.TeamProject | String | The work item TeamProject. A group of project members focused on specific products, services, or feature areas. | +| AzureDevOps.WorkItem.fields.System.IterationPath | String | The work item IterationPath. Iteration paths allow you to group work into sprints, milestones, or other event-specific or time-related period. | +| AzureDevOps.WorkItem.fields.System.WorkItemType | String | The work item type. Epic, Feature, User Story and Task/Bug. | +| AzureDevOps.WorkItem.fields.System.State | String | Workflow states define how a work item progresses from its creation to closure. The four main states that are defined for the User Story describe a user story's progression. The workflow states are New, Active, Resolved, and Closed. | +| AzureDevOps.WorkItem.fields.System.Reason | String | This field requires a state to determine what values are allowed. | +| AzureDevOps.WorkItem.fields.System.AssignedTo.displayName | String | Display name of user assigned to the work item. | +| AzureDevOps.WorkItem.fields.System.AssignedTo.url | String | The work item url. | +| AzureDevOps.WorkItem.fields.System.AssignedTo._links.avatar.href | String | This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. | +| AzureDevOps.WorkItem.fields.System.AssignedTo.id | String | ID of user assigned to the work item. | +| AzureDevOps.WorkItem.fields.System.AssignedTo.uniqueName | String | The unique name of user assigned to the work item. | +| AzureDevOps.WorkItem.fields.System.AssignedTo.imageUrl | String | Link to the user \(assigned to the work item\) image. | +| AzureDevOps.WorkItem.fields.System.AssignedTo.descriptor | String | The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. | +| AzureDevOps.WorkItem.fields.System.CreatedDate | Date | The run creation date, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z". | +| AzureDevOps.WorkItem.fields.System.CreatedBy.displayName | String | Display name of user created the work item. | +| AzureDevOps.WorkItem.fields.System.CreatedBy.url | String | The work item url. | +| AzureDevOps.WorkItem.fields.System.CreatedBy._links.avatar.href | String | This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. | +| AzureDevOps.WorkItem.fields.System.CreatedBy.id | String | ID of user created the work item. | +| AzureDevOps.WorkItem.fields.System.CreatedBy.uniqueName | String | The unique name of user created the work item. | +| AzureDevOps.WorkItem.fields.System.CreatedBy.imageUrl | String | Link to the user \(created the work item\) image. | +| AzureDevOps.WorkItem.fields.System.CreatedBy.descriptor | String | The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. | +| AzureDevOps.WorkItem.fields.System.ChangedDate | Date | The run changing date, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z". | +| AzureDevOps.WorkItem.fields.System.ChangedBy.displayName | String | Display name of user changed the work item. | +| AzureDevOps.WorkItem.fields.System.ChangedBy.url | String | The work item url. | +| AzureDevOps.WorkItem.fields.System.ChangedBy._links.avatar.href | String | This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. | +| AzureDevOps.WorkItem.fields.System.ChangedBy.id | String | ID of user changed the work item. | +| AzureDevOps.WorkItem.fields.System.ChangedBy.uniqueName | String | The unique name of user changed the work item. | +| AzureDevOps.WorkItem.fields.System.ChangedBy.imageUrl | String | Link to the user \(changed the work item\) image. | +| AzureDevOps.WorkItem.fields.System.ChangedBy.descriptor | String | The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. | +| AzureDevOps.WorkItem.fields.System.CommentCount | Number | Count of the work item comments. | +| AzureDevOps.WorkItem.fields.System.Title | String | The work item title. | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.StateChangeDate | Date | The state changing date, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z". | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedDate | Date | The activated date, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z". | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.displayName | String | Display name of user activated the work item. | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.url | String | The work item url. | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy._links.avatar.href | String | This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.id | String | ID of user activated the work item. | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.uniqueName | String | The unique name of user activated the work item. | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.imageUrl | String | Link to the user \(activated the work item\) image. | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.descriptor | String | The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.Priority | Number | This field specifies which work the team should do first. | +| AzureDevOps.WorkItem.fields.System.Description | String | The work item description. | +| AzureDevOps.WorkItem.fields.System.Tags | String | Tags related to the work item. | +| AzureDevOps.WorkItem._links.self.href | String | A collection of related REST reference links. | +| AzureDevOps.WorkItem._links.workItemUpdates.href | String | Link to the work item updates. | +| AzureDevOps.WorkItem._links.workItemRevisions.href | String | Link to the work item revisions. | +| AzureDevOps.WorkItem._links.workItemComments.href | String | Link to the work item comments. | +| AzureDevOps.WorkItem._links.html.href | String | Link to the work item html. | +| AzureDevOps.WorkItem._links.workItemType.href | String | Link to the work item type. | +| AzureDevOps.WorkItem._links.fields.href | String | Link to the work item fields. | +| AzureDevOps.WorkItem.url | String | Link to the work item. | + +### azure-devops-work-item-create + +*** +Creates a single work item. + +#### Base Command + +`azure-devops-work-item-create` + +#### Input + +| **Argument Name** | **Description** | **Required** | +| --- | --- | --- | +| organization_name | The name of the Azure DevOps organization. Default value will be config param, user can supply a different value. | Optional | +| project_name | Project ID or project name. Default value will be config param, user can supply a different value. | Optional | +| type | The work item type of the work item to create. Possible values are: Task, Epic, Issue. | Required | +| title | The work item title of the work item to create. | Required | +| iteration_path | The path for the operation. | Optional | +| description | Describes the work item. | Optional | +| priority | Specifies which work the team should do first. Possible values are: 1, 2, 3, 4. | Optional | +| tag | Tag related to the work item. | Optional | + +#### Context Output + +| **Path** | **Type** | **Description** | +| --- | --- | --- | +| AzureDevOps.WorkItem.id | Number | The work item ID. | +| AzureDevOps.WorkItem.rev | Number | Revision number of the work item. | +| AzureDevOps.WorkItem.fields.System.AreaPath | String | The work item AreaPath. Area paths allow you to group work items by team, product, or feature area. | +| AzureDevOps.WorkItem.fields.System.TeamProject | String | The work item TeamProject. A group of project members focused on specific products, services, or feature areas. | +| AzureDevOps.WorkItem.fields.System.IterationPath | String | The work item IterationPath. Iteration paths allow you to group work into sprints, milestones, or other event-specific or time-related period. | +| AzureDevOps.WorkItem.fields.System.WorkItemType | String | The work item type. Epic, Feature, User Story and Task/Bug. | +| AzureDevOps.WorkItem.fields.System.State | String | Workflow states define how a work item progresses from its creation to closure. The four main states that are defined for the User Story describe a user story's progression. The workflow states are New, Active, Resolved, and Closed. | +| AzureDevOps.WorkItem.fields.System.Reason | String | This field requires a state to determine what values are allowed. | +| AzureDevOps.WorkItem.fields.System.CreatedDate | Date | The run creation date, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z". | +| AzureDevOps.WorkItem.fields.System.CreatedBy.displayName | String | Display name of user created the work item. | +| AzureDevOps.WorkItem.fields.System.CreatedBy.url | String | The work item url. | +| AzureDevOps.WorkItem.fields.System.CreatedBy._links.avatar.href | String | This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. | +| AzureDevOps.WorkItem.fields.System.CreatedBy.id | String | ID of user created the work item. | +| AzureDevOps.WorkItem.fields.System.CreatedBy.uniqueName | String | The unique name of user created the work item. | +| AzureDevOps.WorkItem.fields.System.CreatedBy.imageUrl | String | Link to the user \(created the work item\) image. | +| AzureDevOps.WorkItem.fields.System.CreatedBy.descriptor | String | The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. | +| AzureDevOps.WorkItem.fields.System.ChangedDate | Date | The run changing date, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z". | +| AzureDevOps.WorkItem.fields.System.ChangedBy.displayName | String | Display name of user changed the work item. | +| AzureDevOps.WorkItem.fields.System.ChangedBy.url | String | The work item url. | +| AzureDevOps.WorkItem.fields.System.ChangedBy._links.avatar.href | String | This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. | +| AzureDevOps.WorkItem.fields.System.ChangedBy.id | String | ID of user changed the work item. | +| AzureDevOps.WorkItem.fields.System.ChangedBy.uniqueName | String | The unique name of user changed the work item. | +| AzureDevOps.WorkItem.fields.System.ChangedBy.imageUrl | String | Link to the user \(changed the work item\) image. | +| AzureDevOps.WorkItem.fields.System.ChangedBy.descriptor | String | The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. | +| AzureDevOps.WorkItem.fields.System.CommentCount | Number | Count of the work item comments. | +| AzureDevOps.WorkItem.fields.System.Title | String | The work item title. | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.StateChangeDate | Date | The state changing date, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z". | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.Priority | Number | This field specifies which work the team should do first. | +| AzureDevOps.WorkItem.fields.System.Description | String | The work item description. | +| AzureDevOps.WorkItem.fields.System.Tags | String | Tags related to the work item. | +| AzureDevOps.WorkItem._links.self.href | String | A collection of related REST reference links. | +| AzureDevOps.WorkItem._links.workItemUpdates.href | String | Link to the work item updates. | +| AzureDevOps.WorkItem._links.workItemRevisions.href | String | Link to the work item revisions. | +| AzureDevOps.WorkItem._links.workItemComments.href | String | Link to the work item comments. | +| AzureDevOps.WorkItem._links.html.href | String | Link to the work item html. | +| AzureDevOps.WorkItem._links.workItemType.href | String | Link to the work item type. | +| AzureDevOps.WorkItem._links.fields.href | String | Link to the work item fields. | +| AzureDevOps.WorkItem.url | String | Link to the work item. | + +### azure-devops-work-item-update + +*** +Updates a single work item. + +#### Base Command + +`azure-devops-work-item-update` + +#### Input + +| **Argument Name** | **Description** | **Required** | +| --- | --- | --- | +| organization_name | The name of the Azure DevOps organization. Default value will be config param, user can supply a different value. | Optional | +| project_name | Project ID or project name. Default value will be config param, user can supply a different value. | Optional | +| repository_id | The repository ID. Default value will be config param, user can supply a different value. | Optional | +| item_id | The work item id to update. | Required | +| title | A new title for the work item. | Optional | +| assignee_display_name | Display name of user assigned to the work item. This argument can be obtained by running the 'azure-devops-user-list' command. | Optional | +| state | A new state for the work item. Possible values are: To Do, Doing, Done. | Optional | +| iteration_path | a new path for the operation. | Optional | +| description | A new description for the work item. | Optional | +| priority | A new priority for the work item. Possible values are: 1, 2, 3, 4. | Optional | +| tag | A new priority for the work item. | Optional | + +#### Context Output + +| **Path** | **Type** | **Description** | +| --- | --- | --- | +| AzureDevOps.WorkItem.id | Number | The work item ID. | +| AzureDevOps.WorkItem.rev | Number | Revision number of the work item. | +| AzureDevOps.WorkItem.fields.System.AreaPath | String | The work item AreaPath. Area paths allow you to group work items by team, product, or feature area. | +| AzureDevOps.WorkItem.fields.System.TeamProject | String | The work item TeamProject. A group of project members focused on specific products, services, or feature areas. | +| AzureDevOps.WorkItem.fields.System.IterationPath | String | The work item IterationPath. Iteration paths allow you to group work into sprints, milestones, or other event-specific or time-related period. | +| AzureDevOps.WorkItem.fields.System.WorkItemType | String | The work item type. Epic, Feature, User Story and Task/Bug. | +| AzureDevOps.WorkItem.fields.System.State | String | Workflow states define how a work item progresses from its creation to closure. The four main states that are defined for the User Story describe a user story's progression. The workflow states are New, Active, Resolved, and Closed. | +| AzureDevOps.WorkItem.fields.System.Reason | String | This field requires a state to determine what values are allowed. | +| AzureDevOps.WorkItem.fields.System.AssignedTo.displayName | String | Display name of user assigned to the work item. | +| AzureDevOps.WorkItem.fields.System.AssignedTo.url | String | The work item url. | +| AzureDevOps.WorkItem.fields.System.AssignedTo._links.avatar.href | String | This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. | +| AzureDevOps.WorkItem.fields.System.AssignedTo.id | String | ID of user assigned to the work item. | +| AzureDevOps.WorkItem.fields.System.AssignedTo.uniqueName | String | The unique name of user assigned to the work item. | +| AzureDevOps.WorkItem.fields.System.AssignedTo.imageUrl | String | Link to the user \(assigned to the work item\) image. | +| AzureDevOps.WorkItem.fields.System.AssignedTo.descriptor | String | The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. | +| AzureDevOps.WorkItem.fields.System.CreatedDate | Date | The run creation date, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z". | +| AzureDevOps.WorkItem.fields.System.CreatedBy.displayName | String | Display name of user created the work item. | +| AzureDevOps.WorkItem.fields.System.CreatedBy.url | String | The work item url. | +| AzureDevOps.WorkItem.fields.System.CreatedBy._links.avatar.href | String | This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. | +| AzureDevOps.WorkItem.fields.System.CreatedBy.id | String | ID of user created the work item. | +| AzureDevOps.WorkItem.fields.System.CreatedBy.uniqueName | String | The unique name of user created the work item. | +| AzureDevOps.WorkItem.fields.System.CreatedBy.imageUrl | String | Link to the user \(created the work item\) image. | +| AzureDevOps.WorkItem.fields.System.CreatedBy.descriptor | String | The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. | +| AzureDevOps.WorkItem.fields.System.ChangedDate | Date | The run changing date, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z". | +| AzureDevOps.WorkItem.fields.System.ChangedBy.displayName | String | Display name of user changed the work item. | +| AzureDevOps.WorkItem.fields.System.ChangedBy.url | String | The work item url. | +| AzureDevOps.WorkItem.fields.System.ChangedBy._links.avatar.href | String | This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. | +| AzureDevOps.WorkItem.fields.System.ChangedBy.id | String | ID of user changed the work item. | +| AzureDevOps.WorkItem.fields.System.ChangedBy.uniqueName | String | The unique name of user changed the work item. | +| AzureDevOps.WorkItem.fields.System.ChangedBy.imageUrl | String | Link to the user \(changed the work item\) image. | +| AzureDevOps.WorkItem.fields.System.ChangedBy.descriptor | String | The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. | +| AzureDevOps.WorkItem.fields.System.CommentCount | Number | Count of the work item comments. | +| AzureDevOps.WorkItem.fields.System.Title | String | The work item title. | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.StateChangeDate | Date | The state changing date, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z". | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedDate | Date | The activated date, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z". | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.displayName | String | Display name of user activated the work item. | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.url | String | The work item url. | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy._links.avatar.href | String | This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.id | String | ID of user activated the work item. | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.uniqueName | String | The unique name of user activated the work item. | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.imageUrl | String | Link to the user \(activated the work item\) image. | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.ActivatedBy.descriptor | String | The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. | +| AzureDevOps.WorkItem.fields.Microsoft.VSTS.Common.Priority | Number | This field specifies which work the team should do first. | +| AzureDevOps.WorkItem.fields.System.Description | String | The work item description. | +| AzureDevOps.WorkItem.fields.System.Tags | String | Tags related to the work item. | +| AzureDevOps.WorkItem._links.self.href | String | A collection of related REST reference links. | +| AzureDevOps.WorkItem._links.workItemUpdates.href | String | Link to the work item updates. | +| AzureDevOps.WorkItem._links.workItemRevisions.href | String | Link to the work item revisions. | +| AzureDevOps.WorkItem._links.workItemComments.href | String | Link to the work item comments. | +| AzureDevOps.WorkItem._links.html.href | String | Link to the work item html. | +| AzureDevOps.WorkItem._links.workItemType.href | String | Link to the work item type. | +| AzureDevOps.WorkItem._links.fields.href | String | Link to the work item fields. | +| AzureDevOps.WorkItem.url | String | Link to the work item. | + +### azure-devops-file-create + +*** +Add a file to the repository. + +#### Base Command + +`azure-devops-file-create` + +#### Input + +| **Argument Name** | **Description** | **Required** | +| --- | --- | --- | +| organization_name | The name of the Azure DevOps organization. Default value will be config param, user can supply a different value. | Optional | +| project_name | Project ID or project name. Default value will be config param, user can supply a different value. | Optional | +| repository_id | The repository ID. Default value will be config param, user can supply a different value. | Optional | +| branch_name | The branch name. This argument can be obtained by running the 'azure-devops-branch-list' command. | Required | +| branch_id | The branch ID. This argument can be obtained by running the 'azure-devops-branch-list' command. | Required | +| commit_comment | Comment or message of the commit. | Required | +| file_path | The file path. | Optional | +| file_content | The file content. | Optional | +| entry_id | There is an option to the user to provide an entry_id. In that case we will take the file_content and the file_path from the given id. | Optional | + +#### Context Output + +| **Path** | **Type** | **Description** | +| --- | --- | --- | +| AzureDevOps.File.commits.treeId | String | Tree ID of the commit. | +| AzureDevOps.File.commits.commitId | String | ID \(SHA-1\) of the commit. | +| AzureDevOps.File.commits.author.name | String | Name of the commit author. | +| AzureDevOps.File.commits.author.email | String | Email address of the commit author. | +| AzureDevOps.File.commits.author.date | Date | Date of the commit operation. | +| AzureDevOps.File.commits.committer.name | String | Name of the commit committer. | +| AzureDevOps.File.commits.committer.email | String | Email address of the commit committer. | +| AzureDevOps.File.commits.committer.date | Date | Date of the commit operation. | +| AzureDevOps.File.commits.comment | String | Comment or message of the commit. | +| AzureDevOps.File.commits.parents | String | An enumeration of the parent commit IDs for this commit. | +| AzureDevOps.File.commits.url | String | REST URL for this resource. | +| AzureDevOps.File.refUpdates.repositoryId | String | The ID of the repository. | +| AzureDevOps.File.refUpdates.name | String | The branch name. | +| AzureDevOps.File.refUpdates.oldObjectId | String | The last commit ID. | +| AzureDevOps.File.refUpdates.newObjectId | String | The new commit ID. | +| AzureDevOps.File.repository.id | String | The ID of the repository. | +| AzureDevOps.File.repository.name | String | The name of the repository. | +| AzureDevOps.File.repository.url | String | The URL of the repository. | +| AzureDevOps.File.repository.project.id | String | The ID of the Project. | +| AzureDevOps.File.repository.project.name | String | The name of the project. | +| AzureDevOps.File.repository.project.description | String | The description of the project. | +| AzureDevOps.File.repository.project.url | String | The URL of the project. | +| AzureDevOps.File.repository.project.state | String | The state of the project. | +| AzureDevOps.File.repository.project.revision | Number | The revision number of the project. | +| AzureDevOps.File.repository.project.visibility | String | Indicates whom the project is visible to. | +| AzureDevOps.File.repository.project.lastUpdateTime | Date | The project last update time, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z". | +| AzureDevOps.File.repository.size | Number | The size of the repository \(in bytes\). | +| AzureDevOps.File.repository.remoteUrl | String | Remote URL path to the repository. | +| AzureDevOps.File.repository.sshUrl | String | The ssh URL of the repository. | +| AzureDevOps.File.repository.webUrl | String | The web URL of the repository. | +| AzureDevOps.File.repository.isDisabled | Boolean | If the repository is disabled or not. | +| AzureDevOps.File.repository.isInMaintenance | Boolean | If the repository is in maintenance or not. | +| AzureDevOps.File.pushedBy.displayName | String | Display name of the user who pushed the commit / file. | +| AzureDevOps.File.pushedBy.url | String | Identity Reference. | +| AzureDevOps.File.pushedBy._links.avatar.href | String | Url for the user's avatar. | +| AzureDevOps.File.pushedBy.id | String | ID of the user who pushed the commit / file. | +| AzureDevOps.File.pushedBy.uniqueName | String | Domain and principal name. | +| AzureDevOps.File.pushedBy.imageUrl | String | Identity Image. | +| AzureDevOps.File.pushedBy.descriptor | String | The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. | +| AzureDevOps.File.pushId | Number | Unique ID of the push operation. | +| AzureDevOps.File.date | Date | Date of the operation. | +| AzureDevOps.File.url | String | Link to the commit. | +| AzureDevOps.File._links.self.href | String | A collection of related REST reference links. | +| AzureDevOps.File._links.repository.href | String | Link to the repository where the commit is. | +| AzureDevOps.File._links.commits.href | String | Link to the commits. | +| AzureDevOps.File._links.pusher.href | String | Link to the commit pusher. | +| AzureDevOps.File._links.refs.href | String | Link to the branch. | + +### azure-devops-file-update + +*** +Update a file in the repository. + +#### Base Command + +`azure-devops-file-update` + +#### Input + +| **Argument Name** | **Description** | **Required** | +| --- | --- | --- | +| organization_name | The name of the Azure DevOps organization. Default value will be config param, user can supply a different value. | Optional | +| project_name | Project ID or project name. Default value will be config param, user can supply a different value. | Optional | +| repository_id | The repository ID. Default value will be config param, user can supply a different value. | Optional | +| branch_name | The branch name. This argument can be obtained by running the 'azure-devops-branch-list' command. | Required | +| branch_id | The branch ID. This argument can be obtained by running the 'azure-devops-branch-list' command. | Required | +| commit_comment | Comment or message of the commit. | Required | +| file_path | The file path. | Optional | +| file_content | The file content. | Optional | +| entry_id | There is an option to the user to provide an entry_id. In that case we will take the file_content and the file_path from the given id. | Optional | + +#### Context Output + +| **Path** | **Type** | **Description** | +| --- | --- | --- | +| AzureDevOps.File.commits.treeId | String | Tree ID of the commit. | +| AzureDevOps.File.commits.commitId | String | ID \(SHA-1\) of the commit. | +| AzureDevOps.File.commits.author.name | String | Name of the commit author. | +| AzureDevOps.File.commits.author.email | String | Email address of the commit author. | +| AzureDevOps.File.commits.author.date | Date | Date of the commit operation. | +| AzureDevOps.File.commits.committer.name | String | Name of the commit committer. | +| AzureDevOps.File.commits.committer.email | String | Email address of the commit committer. | +| AzureDevOps.File.commits.committer.date | Date | Date of the commit operation. | +| AzureDevOps.File.commits.comment | String | Comment or message of the commit. | +| AzureDevOps.File.commits.parents | String | An enumeration of the parent commit IDs for this commit. | +| AzureDevOps.File.commits.url | String | REST URL for this resource. | +| AzureDevOps.File.refUpdates.repositoryId | String | The ID of the repository. | +| AzureDevOps.File.refUpdates.name | String | The branch name. | +| AzureDevOps.File.refUpdates.oldObjectId | String | The last commit ID. | +| AzureDevOps.File.refUpdates.newObjectId | String | The new commit ID. | +| AzureDevOps.File.repository.id | String | The ID of the repository. | +| AzureDevOps.File.repository.name | String | The name of the repository. | +| AzureDevOps.File.repository.url | String | The URL of the repository. | +| AzureDevOps.File.repository.project.id | String | The ID of the Project. | +| AzureDevOps.File.repository.project.name | String | The name of the project. | +| AzureDevOps.File.repository.project.description | String | The description of the project. | +| AzureDevOps.File.repository.project.url | String | The URL of the project. | +| AzureDevOps.File.repository.project.state | String | The state of the project. | +| AzureDevOps.File.repository.project.revision | Number | The revision number of the project. | +| AzureDevOps.File.repository.project.visibility | String | Indicates whom the project is visible to. | +| AzureDevOps.File.repository.project.lastUpdateTime | Date | The project last update time, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z". | +| AzureDevOps.File.repository.size | Number | The size of the repository \(in bytes\). | +| AzureDevOps.File.repository.remoteUrl | String | Remote URL path to the repository. | +| AzureDevOps.File.repository.sshUrl | String | The ssh URL of the repository. | +| AzureDevOps.File.repository.webUrl | String | The web URL of the repository. | +| AzureDevOps.File.repository.isDisabled | Boolean | If the repository is disabled or not. | +| AzureDevOps.File.repository.isInMaintenance | Boolean | If the repository is in maintenance or not. | +| AzureDevOps.File.pushedBy.displayName | String | Display name of the user who pushed the commit / file. | +| AzureDevOps.File.pushedBy.url | String | Identity Reference. | +| AzureDevOps.File.pushedBy._links.avatar.href | String | Url for the user's avatar. | +| AzureDevOps.File.pushedBy.id | String | ID of the user who pushed the commit / file. | +| AzureDevOps.File.pushedBy.uniqueName | String | Domain and principal name. | +| AzureDevOps.File.pushedBy.imageUrl | String | Identity Image. | +| AzureDevOps.File.pushedBy.descriptor | String | The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. | +| AzureDevOps.File.pushId | Number | Unique ID of the push operation. | +| AzureDevOps.File.date | Date | Date of the operation. | +| AzureDevOps.File.url | String | Link to the commit. | +| AzureDevOps.File._links.self.href | String | A collection of related REST reference links. | +| AzureDevOps.File._links.repository.href | String | Link to the repository where the commit is. | +| AzureDevOps.File._links.commits.href | String | Link to the commits. | +| AzureDevOps.File._links.pusher.href | String | Link to the commit pusher. | +| AzureDevOps.File._links.refs.href | String | Link to the branch. | + +### azure-devops-file-delete + +*** +Update a file in the repository. + +#### Base Command + +`azure-devops-file-delete` + +#### Input + +| **Argument Name** | **Description** | **Required** | +| --- | --- | --- | +| organization_name | The name of the Azure DevOps organization. Default value will be config param, user can supply a different value. | Optional | +| project_name | Project ID or project name. Default value will be config param, user can supply a different value. | Optional | +| repository_id | The repository ID. Default value will be config param, user can supply a different value. | Optional | +| branch_name | The branch name. This argument can be obtained by running the 'azure-devops-branch-list' command. | Required | +| branch_id | The branch ID. This argument can be obtained by running the 'azure-devops-branch-list' command. | Required | +| commit_comment | Comment or message of the commit. | Required | +| file_path | The file path. | Optional | +| entry_id | There is an option to the user to provide an entry_id. In that case we will take the file_content and the file_path from the given id. | Optional | + +#### Context Output + +| **Path** | **Type** | **Description** | +| --- | --- | --- | +| AzureDevOps.File.commits.treeId | String | Tree ID of the commit. | +| AzureDevOps.File.commits.commitId | String | ID \(SHA-1\) of the commit. | +| AzureDevOps.File.commits.author.name | String | Name of the commit author. | +| AzureDevOps.File.commits.author.email | String | Email address of the commit author. | +| AzureDevOps.File.commits.author.date | Date | Date of the commit operation. | +| AzureDevOps.File.commits.committer.name | String | Name of the commit committer. | +| AzureDevOps.File.commits.committer.email | String | Email address of the commit committer. | +| AzureDevOps.File.commits.committer.date | Date | Date of the commit operation. | +| AzureDevOps.File.commits.comment | String | Comment or message of the commit. | +| AzureDevOps.File.commits.parents | String | An enumeration of the parent commit IDs for this commit. | +| AzureDevOps.File.commits.url | String | REST URL for this resource. | +| AzureDevOps.File.refUpdates.repositoryId | String | The ID of the repository. | +| AzureDevOps.File.refUpdates.name | String | The branch name. | +| AzureDevOps.File.refUpdates.oldObjectId | String | The last commit ID. | +| AzureDevOps.File.refUpdates.newObjectId | String | The new commit ID. | +| AzureDevOps.File.repository.id | String | The ID of the repository. | +| AzureDevOps.File.repository.name | String | The name of the repository. | +| AzureDevOps.File.repository.url | String | The URL of the repository. | +| AzureDevOps.File.repository.project.id | String | The ID of the Project. | +| AzureDevOps.File.repository.project.name | String | The name of the project. | +| AzureDevOps.File.repository.project.description | String | The description of the project. | +| AzureDevOps.File.repository.project.url | String | The URL of the project. | +| AzureDevOps.File.repository.project.state | String | The state of the project. | +| AzureDevOps.File.repository.project.revision | Number | The revision number of the project. | +| AzureDevOps.File.repository.project.visibility | String | Indicates whom the project is visible to. | +| AzureDevOps.File.repository.project.lastUpdateTime | Date | The project last update time, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z". | +| AzureDevOps.File.repository.size | Number | The size of the repository \(in bytes\). | +| AzureDevOps.File.repository.remoteUrl | String | Remote URL path to the repository. | +| AzureDevOps.File.repository.sshUrl | String | The ssh URL of the repository. | +| AzureDevOps.File.repository.webUrl | String | The web URL of the repository. | +| AzureDevOps.File.repository.isDisabled | Boolean | If the repository is disabled or not. | +| AzureDevOps.File.repository.isInMaintenance | Boolean | If the repository is in maintenance or not. | +| AzureDevOps.File.pushedBy.displayName | String | Display name of the user who pushed the commit / file. | +| AzureDevOps.File.pushedBy.url | String | Identity Reference. | +| AzureDevOps.File.pushedBy._links.avatar.href | String | Url for the user's avatar. | +| AzureDevOps.File.pushedBy.id | String | ID of the user who pushed the commit / file. | +| AzureDevOps.File.pushedBy.uniqueName | String | Domain and principal name. | +| AzureDevOps.File.pushedBy.imageUrl | String | Identity Image. | +| AzureDevOps.File.pushedBy.descriptor | String | The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. | +| AzureDevOps.File.pushId | Number | Unique ID of the push operation. | +| AzureDevOps.File.date | Date | Date of the operation. | +| AzureDevOps.File.url | String | Link to the commit. | +| AzureDevOps.File._links.self.href | String | A collection of related REST reference links. | +| AzureDevOps.File._links.repository.href | String | Link to the repository where the commit is. | +| AzureDevOps.File._links.commits.href | String | Link to the commits. | +| AzureDevOps.File._links.pusher.href | String | Link to the commit pusher. | +| AzureDevOps.File._links.refs.href | String | Link to the branch. | + +### azure-devops-file-list + +*** +Retrieve repository files (items) list. + +#### Base Command + +`azure-devops-file-list` + +#### Input + +| **Argument Name** | **Description** | **Required** | +| --- | --- | --- | +| organization_name | The name of the Azure DevOps organization. Default value will be config param, user can supply a different value. | Optional | +| project_name | Project ID or project name. Default value will be config param, user can supply a different value. | Optional | +| repository_id | The repository ID. Default value will be config param, user can supply a different value. | Optional | +| branch_name | The branch name. This argument can be obtained by running the 'azure-devops-branch-list' command. | Required | +| recursion_level | The recursion level of this request. The default is None, no recursion. Possible values are: None, OneLevel, Full. Default is None. | Optional | + +#### Context Output + +| **Path** | **Type** | **Description** | +| --- | --- | --- | +| AzureDevOps.File.objectId | String | The file object ID. | +| AzureDevOps.File.gitObjectType | String | The file git object type. | +| AzureDevOps.File.commitId | String | ID \(SHA-1\) of the file commit. | +| AzureDevOps.File.path | String | The file's path. | +| AzureDevOps.File.isFolder | Boolean | If the item is folder or not. | +| AzureDevOps.File.contentMetadata.fileName | String | The file name. | +| AzureDevOps.File.url | String | URL link to the item. | + +### azure-devops-file-get + +*** +Getting the content file. + +#### Base Command + +`azure-devops-file-get` + +#### Input + +| **Argument Name** | **Description** | **Required** | +| --- | --- | --- | +| organization_name | The name of the Azure DevOps organization. Default value will be config param, user can supply a different value. | Optional | +| project_name | Project ID or project name. Default value will be config param, user can supply a different value. | Optional | +| repository_id | The repository ID. Default value will be config param, user can supply a different value. | Optional | +| branch_name | The branch name. This argument can be obtained by running the 'azure-devops-branch-list' command. | Required | +| file_name | The file name. | Required | +| format | The file format (json or zip). Default is json. Possible values are: json, zip. Default is json. | Optional | +| include_content | Include item content. Default is True. Possible values are: True, False. Default is True. | Optional | + +#### Context Output + +| **Path** | **Type** | **Description** | +| --- | --- | --- | +| AzureDevOps.File.objectId | String | The file object ID. | +| AzureDevOps.File.gitObjectType | String | The file git object type. | +| AzureDevOps.File.commitId | String | ID \(SHA-1\) of the file commit. | +| AzureDevOps.File.path | String | The file's path. | +| AzureDevOps.File.content | String | The file content. | + +### azure-devops-branch-create + +*** +Create a branch. + +#### Base Command + +`azure-devops-branch-create` + +#### Input + +| **Argument Name** | **Description** | **Required** | +| --- | --- | --- | +| organization_name | The name of the Azure DevOps organization. Default value will be config param, user can supply a different value. | Optional | +| project_name | Project ID or project name. Default value will be config param, user can supply a different value. | Optional | +| repository_id | The repository ID. Default value will be config param, user can supply a different value. | Optional | +| branch_name | The branch name. This argument can be obtained by running the 'azure-devops-branch-list' command. | Required | +| commit_comment | Comment or message of the commit. | Required | +| file_path | The file path. | Optional | +| file_content | The file content. | Optional | +| entry_id | There is an option to the user to provide an entry_id. In that case we will take the file_content and the file_path from the given id. | Optional | + +#### Context Output + +| **Path** | **Type** | **Description** | +| --- | --- | --- | +| AzureDevOps.Branch.commits.treeId | String | Tree ID of the commit. | +| AzureDevOps.Branch.commits.commitId | String | ID \(SHA-1\) of the commit. | +| AzureDevOps.Branch.commits.author.name | String | Name of the commit author. | +| AzureDevOps.Branch.commits.author.email | String | Email address of the commit author. | +| AzureDevOps.Branch.commits.author.date | Date | Date of the commit operation. | +| AzureDevOps.Branch.commits.committer.name | String | Name of the commit committer. | +| AzureDevOps.Branch.commits.committer.email | String | Email address of the commit committer. | +| AzureDevOps.Branch.commits.committer.date | Date | Date of the commit operation. | +| AzureDevOps.Branch.commits.comment | String | Comment or message of the commit. | +| AzureDevOps.Branch.commits.parents | Unknown | An enumeration of the parent commit IDs for this commit. | +| AzureDevOps.Branch.commits.url | String | REST URL for this resource. | +| AzureDevOps.Branch.refUpdates.repositoryId | String | The ID of the repository. | +| AzureDevOps.Branch.refUpdates.name | String | The branch name. | +| AzureDevOps.Branch.refUpdates.oldObjectId | String | The last commit ID. | +| AzureDevOps.Branch.refUpdates.newObjectId | String | The new commit ID. | +| AzureDevOps.Branch.repository.id | String | The ID of the repository. | +| AzureDevOps.Branch.repository.name | String | The name of the repository. | +| AzureDevOps.Branch.repository.url | String | The URL of the repository. | +| AzureDevOps.Branch.repository.project.id | String | The ID of the Project. | +| AzureDevOps.Branch.repository.project.name | String | The name of the project. | +| AzureDevOps.Branch.repository.project.description | String | The description of the project. | +| AzureDevOps.Branch.repository.project.url | String | The URL of the project. | +| AzureDevOps.Branch.repository.project.state | String | The state of the project. | +| AzureDevOps.Branch.repository.project.revision | Number | The revision number of the project. | +| AzureDevOps.Branch.repository.project.visibility | String | Indicates whom the project is visible to. | +| AzureDevOps.Branch.repository.project.lastUpdateTime | Date | The project last update time, using ISO 8601 format in UTC time. For example, midnight UTC on Jan 1, 2022 would be: "2022-01-01T00:00:00Z". | +| AzureDevOps.Branch.repository.size | Number | The size of the repository \(in bytes\). | +| AzureDevOps.Branch.repository.remoteUrl | String | Remote URL path to the repository. | +| AzureDevOps.Branch.repository.sshUrl | String | The ssh URL of the repository. | +| AzureDevOps.Branch.repository.webUrl | String | The web URL of the repository. | +| AzureDevOps.Branch.repository.isDisabled | Boolean | If the repository is disabled or not. | +| AzureDevOps.Branch.repository.isInMaintenance | Boolean | If the repository is in maintenance or not. | +| AzureDevOps.Branch.pushedBy.displayName | String | Display name of the user who pushed the commit / file. | +| AzureDevOps.Branch.pushedBy.url | String | Identity Reference. | +| AzureDevOps.Branch.pushedBy._links.avatar.href | String | Url for the user's avatar. | +| AzureDevOps.Branch.pushedBy.id | String | ID of the user who pushed the commit / file. | +| AzureDevOps.Branch.pushedBy.uniqueName | String | Domain and principal name. | +| AzureDevOps.Branch.pushedBy.imageUrl | String | Identity Image. | +| AzureDevOps.Branch.pushedBy.descriptor | String | The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. | +| AzureDevOps.Branch.pushId | Number | Unique ID of the push operation. | +| AzureDevOps.Branch.date | Date | Date of the operation. | +| AzureDevOps.Branch.url | String | Link to the commit. | +| AzureDevOps.Branch._links.self.href | String | A collection of related REST reference links. | +| AzureDevOps.Branch._links.repository.href | String | Link to the repository where the commit is. | +| AzureDevOps.Branch._links.commits.href | String | Link to the commits. | +| AzureDevOps.Branch._links.pusher.href | String | Link to the commit pusher. | +| AzureDevOps.Branch._links.refs.href | String | Link to the branch. | + +### azure-devops-pull-request-thread-create + +*** +Create a thread in a pull request. + +#### Base Command + +`azure-devops-pull-request-thread-create` + +#### Input + +| **Argument Name** | **Description** | **Required** | +| --- | --- | --- | +| organization_name | The name of the Azure DevOps organization. Default value will be config param, user can supply a different value. | Optional | +| project_name | Project ID or project name. Default value will be config param, user can supply a different value. | Optional | +| repository_id | The repository ID. Default value will be config param, user can supply a different value. | Optional | +| pull_request_id | The ID of the pull request to update. | Required | +| comment_text | The comment content. | Required | + +#### Context Output + +| **Path** | **Type** | **Description** | +| --- | --- | --- | +| AzureDevOps.PullRequestThread.pullRequestThreadContext | Unknown | Extended context information unique to pull requests. | +| AzureDevOps.PullRequestThread.id | Number | The ID of the pull request. | +| AzureDevOps.PullRequestThread.publishedDate | Date | The date the thread was published. | +| AzureDevOps.PullRequestThread.lastUpdatedDate | Date | Last update date. | +| AzureDevOps.PullRequestThread.comments.id | Number | The ID of the comments. | +| AzureDevOps.PullRequestThread.comments.parentCommentId | Number | An enumeration of the parent commit IDs for this commit. | +| AzureDevOps.PullRequestThread.comments.author.displayName | String | The display name of the comments creator. | +| AzureDevOps.PullRequestThread.comments.author.url | String | URL to retrieve information about this identity. | +| AzureDevOps.PullRequestThread.comments.author._links.avatar.href | String | This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. | +| AzureDevOps.PullRequestThread.comments.author.id | String | The ID of the thread author. | +| AzureDevOps.PullRequestThread.comments.author.uniqueName | String | The unique name of the thread author. | +| AzureDevOps.PullRequestThread.comments.author.imageUrl | String | Link to the thread author user image. | +| AzureDevOps.PullRequestThread.comments.author.descriptor | String | The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. | +| AzureDevOps.PullRequestThread.comments.content | String | The comments content. | +| AzureDevOps.PullRequestThread.comments.publishedDate | Date | The date the comments were published. | +| AzureDevOps.PullRequestThread.comments.lastUpdatedDate | Date | Last update date. | +| AzureDevOps.PullRequestThread.comments.lastContentUpdatedDate | Date | The date the comment's content was last updated. | +| AzureDevOps.PullRequestThread.comments.commentType | String | The comment type at the time of creation. | +| AzureDevOps.PullRequestThread.comments._links.self.href | String | A collection of related REST reference links. | +| AzureDevOps.PullRequestThread.comments._links.repository.href | String | Link to the repository where the comments are. | +| AzureDevOps.PullRequestThread.comments._links.threads.href | String | Link to the threads. | +| AzureDevOps.PullRequestThread.comments._links.pullRequests.href | String | Link to the pull request. | +| AzureDevOps.PullRequestThread.status | String | The status of the pull request thread. | +| AzureDevOps.PullRequestThread.threadContext | Unknown | Extended context information unique to pull requests. | +| AzureDevOps.PullRequestThread.properties | Unknown | Properties associated with the thread as a collection of key-value pairs. | +| AzureDevOps.PullRequestThread.identities | Unknown | Set of identities related to this thread. | +| AzureDevOps.PullRequestThread.isDeleted | Boolean | Specify if the thread is deleted which happens when all comments are deleted. | +| AzureDevOps.PullRequestThread._links.self.href | String | Link to the thread. | +| AzureDevOps.PullRequestThread._links.repository.href | String | Link to the repository. | + +### azure-devops-pull-request-thread-update + +*** +Update a thread in a pull request. + +#### Base Command + +`azure-devops-pull-request-thread-update` + +#### Input + +| **Argument Name** | **Description** | **Required** | +| --- | --- | --- | +| organization_name | The name of the Azure DevOps organization. Default value will be config param, user can supply a different value. | Optional | +| project_name | Project ID or project name. Default value will be config param, user can supply a different value. | Optional | +| repository_id | The repository ID. Default value will be config param, user can supply a different value. | Optional | +| pull_request_id | The ID of the pull request to update. | Required | +| thread_id | The ID of the thread to update. | Required | +| comment_text | The comment content. | Required | + +#### Context Output + +| **Path** | **Type** | **Description** | +| --- | --- | --- | +| AzureDevOps.PullRequestThread.pullRequestThreadContext | Unknown | Extended context information unique to pull requests. | +| AzureDevOps.PullRequestThread.id | Number | The ID of the pull request. | +| AzureDevOps.PullRequestThread.publishedDate | Date | The date the thread was published. | +| AzureDevOps.PullRequestThread.lastUpdatedDate | Date | Last update date. | +| AzureDevOps.PullRequestThread.comments.id | Number | The ID of the comments. | +| AzureDevOps.PullRequestThread.comments.parentCommentId | Number | An enumeration of the parent commit IDs for this commit. | +| AzureDevOps.PullRequestThread.comments.author.displayName | String | The display name of the comments creator. | +| AzureDevOps.PullRequestThread.comments.author.url | String | URL to retrieve information about this identity. | +| AzureDevOps.PullRequestThread.comments.author._links.avatar.href | String | This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. | +| AzureDevOps.PullRequestThread.comments.author.id | String | The ID of the thread author. | +| AzureDevOps.PullRequestThread.comments.author.uniqueName | String | The unique name of the thread author. | +| AzureDevOps.PullRequestThread.comments.author.imageUrl | String | Link to the thread author user image. | +| AzureDevOps.PullRequestThread.comments.author.descriptor | String | The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. | +| AzureDevOps.PullRequestThread.comments.content | String | The comments content. | +| AzureDevOps.PullRequestThread.comments.publishedDate | Date | The date the comments were published. | +| AzureDevOps.PullRequestThread.comments.lastUpdatedDate | Date | Last update date. | +| AzureDevOps.PullRequestThread.comments.lastContentUpdatedDate | Date | The date the comment's content was last updated. | +| AzureDevOps.PullRequestThread.comments.commentType | String | The comment type at the time of creation. | +| AzureDevOps.PullRequestThread.comments._links.self.href | String | A collection of related REST reference links. | +| AzureDevOps.PullRequestThread.comments._links.repository.href | String | Link to the repository where the comments are. | +| AzureDevOps.PullRequestThread.comments._links.threads.href | String | Link to the threads. | +| AzureDevOps.PullRequestThread.comments._links.pullRequests.href | String | Link to the pull request. | +| AzureDevOps.PullRequestThread.status | String | The status of the pull request thread. | +| AzureDevOps.PullRequestThread.threadContext | Unknown | Extended context information unique to pull requests. | +| AzureDevOps.PullRequestThread.properties | Unknown | Properties associated with the thread as a collection of key-value pairs. | +| AzureDevOps.PullRequestThread.identities | Unknown | Set of identities related to this thread. | +| AzureDevOps.PullRequestThread.isDeleted | Boolean | Specify if the thread is deleted which happens when all comments are deleted. | +| AzureDevOps.PullRequestThread._links.self.href | String | Link to the thread. | +| AzureDevOps.PullRequestThread._links.repository.href | String | Link to the repository. | + +### azure-devops-pull-request-thread-list + +*** +Retrieve all threads in a pull request. + +#### Base Command + +`azure-devops-pull-request-thread-list` + +#### Input + +| **Argument Name** | **Description** | **Required** | +| --- | --- | --- | +| organization_name | The name of the Azure DevOps organization. Default value will be config param, user can supply a different value. | Optional | +| project_name | Project ID or project name. Default value will be config param, user can supply a different value. | Optional | +| repository_id | The repository ID. Default value will be config param, user can supply a different value. | Optional | +| pull_request_id | The ID of the pull request to update. | Required | + +#### Context Output + +| **Path** | **Type** | **Description** | +| --- | --- | --- | +| AzureDevOps.PullRequestThread.pullRequestThreadContext | Unknown | Extended context information unique to pull requests. | +| AzureDevOps.PullRequestThread.id | Number | The ID of the pull request. | +| AzureDevOps.PullRequestThread.publishedDate | Date | The date the thread was published. | +| AzureDevOps.PullRequestThread.lastUpdatedDate | Date | Last update date. | +| AzureDevOps.PullRequestThread.comments.id | Number | The ID of the comments. | +| AzureDevOps.PullRequestThread.comments.parentCommentId | Number | An enumeration of the parent commit IDs for this commit. | +| AzureDevOps.PullRequestThread.comments.author.displayName | String | The display name of the comments creator. | +| AzureDevOps.PullRequestThread.comments.author.url | String | URL to retrieve information about this identity. | +| AzureDevOps.PullRequestThread.comments.author._links.avatar.href | String | This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. | +| AzureDevOps.PullRequestThread.comments.author.id | String | The ID of the thread author. | +| AzureDevOps.PullRequestThread.comments.author.uniqueName | String | The unique name of the thread author. | +| AzureDevOps.PullRequestThread.comments.author.imageUrl | String | Link to the thread author user image. | +| AzureDevOps.PullRequestThread.comments.author.descriptor | String | The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. | +| AzureDevOps.PullRequestThread.comments.content | String | The comments content. | +| AzureDevOps.PullRequestThread.comments.publishedDate | Date | The date the comments were published. | +| AzureDevOps.PullRequestThread.comments.lastUpdatedDate | Date | Last update date. | +| AzureDevOps.PullRequestThread.comments.lastContentUpdatedDate | Date | The date the comment's content was last updated. | +| AzureDevOps.PullRequestThread.comments.commentType | String | The comment type at the time of creation. | +| AzureDevOps.PullRequestThread.comments.usersLiked | Unknown | A list of the users who have liked this comment. | +| AzureDevOps.PullRequestThread.comments._links.self.href | String | A collection of related REST reference links. | +| AzureDevOps.PullRequestThread.comments._links.repository.href | String | Link to the repository where the comments are. | +| AzureDevOps.PullRequestThread.comments._links.threads.href | String | Link to the threads. | +| AzureDevOps.PullRequestThread.comments._links.pullRequests.href | String | Link to the pull request. | +| AzureDevOps.PullRequestThread.threadContext | Unknown | Extended context information unique to pull requests. | +| AzureDevOps.PullRequestThread.properties.CodeReviewThreadType.$type | String | The type of the code review thread. | +| AzureDevOps.PullRequestThread.properties.CodeReviewThreadType.$value | String | The content in the code review thread. | +| AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedNumAdded.$type | String | A number \(Int32\). | +| AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedNumAdded.$value | Number | Number of code reviewers updated the pull request. | +| AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedNumChanged.$type | String | A number \(Int32\). | +| AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedNumChanged.$value | Number | Number of code reviewers changed the pull request. | +| AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedNumDeclined.$type | String | A number \(Int32\). | +| AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedNumDeclined.$value | Number | Number of code reviewers declined the pull request. | +| AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedNumRemoved.$type | String | A number \(Int32\). | +| AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedNumRemoved.$value | Number | Number of code reviewers are removed. | +| AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedAddedIdentity.$type | String | A number \(Int32\). | +| AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedAddedIdentity.$value | String | Number of code reviewers added identity. | +| AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedByIdentity.$type | String | A number \(Int32\). | +| AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedByIdentity.$value | String | Number of code reviewers updated by identity. | +| AzureDevOps.PullRequestThread.identities.1.displayName | String | The display name of the pull request thread creator. | +| AzureDevOps.PullRequestThread.identities.1.url | String | Link to the the pull request thread creator. | +| AzureDevOps.PullRequestThread.identities.1._links.avatar.href | String | This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. | +| AzureDevOps.PullRequestThread.identities.1.id | String | The ID of the pull request thread creator. | +| AzureDevOps.PullRequestThread.identities.1.uniqueName | String | The user name of the pull request thread creator. | +| AzureDevOps.PullRequestThread.identities.1.imageUrl | String | Link to the pull request thread creator user image. | +| AzureDevOps.PullRequestThread.identities.1.descriptor | String | The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. | +| AzureDevOps.PullRequestThread.isDeleted | Boolean | Specify if the thread is deleted which happens when all comments are deleted. | +| AzureDevOps.PullRequestThread._links.self.href | String | Link to the thread. | +| AzureDevOps.PullRequestThread._links.repository.href | String | Link to the repository. | +| AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedChangedToRequired.$type | String | A number \(Int32\). | +| AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedChangedToRequired.$value | String | Number of code reviewers were changed to required. | +| AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedChangedIdentity.$type | String | A number \(Int32\). | +| AzureDevOps.PullRequestThread.properties.CodeReviewReviewersUpdatedChangedIdentity.$value | String | Number of code reviewers changed the identity. | +| AzureDevOps.PullRequestThread.status | String | The status of the comment thread. | +| AzureDevOps.PullRequestThread.properties | Unknown | Properties associated with the thread as a collection of key-value pairs. | +| AzureDevOps.PullRequestThread.identities | Unknown | Set of identities related to this thread. | +| AzureDevOps.PullRequestThread.properties.Microsoft.TeamFoundation.Discussion.SupportsMarkdown.$type | String | A number \(Int32\). | +| AzureDevOps.PullRequestThread.properties.Microsoft.TeamFoundation.Discussion.SupportsMarkdown.$value | Number | Supports markdown number. | +| AzureDevOps.PullRequestThread.properties.Microsoft.TeamFoundation.Discussion.UniqueID.$type | String | A number \(Int32\). | +| AzureDevOps.PullRequestThread.properties.Microsoft.TeamFoundation.Discussion.UniqueID.$value | String | The unique ID of the Team Foundation. | + +### azure-devops-project-team-list + +*** +Get a list of teams. + +#### Base Command + +`azure-devops-project-team-list` + +#### Input + +| **Argument Name** | **Description** | **Required** | +| --- | --- | --- | +| organization_name | The name of the Azure DevOps organization. Default value will be config param, user can supply a different value. | Optional | +| project_name | Project ID or project name. Default value will be config param, user can supply a different value. | Optional | + +#### Context Output + +| **Path** | **Type** | **Description** | +| --- | --- | --- | +| AzureDevOps.Team.id | String | Team \(Identity\) Guid. A Team Foundation ID. | +| AzureDevOps.Team.name | String | Team name. | +| AzureDevOps.Team.url | String | Team REST API Url. | +| AzureDevOps.Team.description | String | Team description. | +| AzureDevOps.Team.identityUrl | String | Identity REST API Url to this team. | +| AzureDevOps.Team.projectName | String | The project name. | +| AzureDevOps.Team.projectId | String | The project ID. | + +### azure-devops-team-member-list + +*** +Get a list of members for a specific team. + +#### Base Command + +`azure-devops-team-member-list` + +#### Input + +| **Argument Name** | **Description** | **Required** | +| --- | --- | --- | +| organization_name | The name of the Azure DevOps organization. Default value will be config param, user can supply a different value. | Optional | +| project_name | Project ID or project name. Default value will be config param, user can supply a different value. | Optional | +| team_id | The name or ID (GUID) of the team . | Required | +| page | The page number of the results to retrieve. Minimum value is 1. Default is 1. | Optional | +| limit | The number of results to retrieve. Minimum value is 1. Default is 50. | Optional | + +#### Context Output + +| **Path** | **Type** | **Description** | +| --- | --- | --- | +| AzureDevOps.TeamMember.isTeamAdmin | Boolean | if the member is the team admin. | +| AzureDevOps.TeamMember.identity.displayName | String | The display name of the team member. | +| AzureDevOps.TeamMember.identity.url | String | URL to retrieve information about this member. | +| AzureDevOps.TeamMember.identity._links.avatar.href | String | This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. | +| AzureDevOps.TeamMember.identity.id | String | ID of the team member. | +| AzureDevOps.TeamMember.identity.uniqueName | String | The unique name of team member. | +| AzureDevOps.TeamMember.identity.imageUrl | String | Link to the team member image. | +| AzureDevOps.TeamMember.identity.descriptor | String | The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. | + +### azure-devops-blob-zip-get + +*** +Get a single blob. + +#### Base Command + +`azure-devops-blob-zip-get` + +#### Input + +| **Argument Name** | **Description** | **Required** | +| --- | --- | --- | +| organization_name | The name of the Azure DevOps organization. Default value will be config param, user can supply a different value. | Optional | +| project_name | Project ID or project name. Default value will be config param, user can supply a different value. | Optional | +| repository_id | The repository ID. Default value will be config param, user can supply a different value. | Optional | +| file_object_id | The ID of the blob object. This ID can be obtained by running the 'azure-devops-file-list' command. | Required | + +#### Context Output + +There is no context output for this command. + + ## Incident Mirroring You can enable incident mirroring between Cortex XSOAR incidents and AzureDevOps corresponding events (available from Cortex XSOAR version 6.0.0). diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/branch_create.json b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/branch_create.json new file mode 100644 index 000000000000..96f745c130ab --- /dev/null +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/branch_create.json @@ -0,0 +1,83 @@ +{ + "commits": [ + { + "treeId": "", + "commitId": "", + "author": { + "name": "", + "email": "", + "date": "2023-07-23T10:32:35Z" + }, + "committer": { + "name": "", + "email": "", + "date": "2023-07-23T10:32:35Z" + }, + "comment": "Initial commit", + "parents": [], + "url": "" + } + ], + "refUpdates": [ + { + "repositoryId": "", + "name": "refs/heads/main", + "oldObjectId": "0000000000000000000000000000000000000000", + "newObjectId": "" + } + ], + "repository": { + "id": "", + "name": "", + "url": "", + "project": { + "id": "", + "name": "", + "description": "Demo project for Azure DevOps instance", + "url": "", + "state": "wellFormed", + "revision": 27, + "visibility": "private", + "lastUpdateTime": "2022-01-31T12:18:37.09Z" + }, + "size": 62931641, + "remoteUrl": "", + "sshUrl": "", + "webUrl": "", + "isDisabled": "false", + "isInMaintenance": "false" + }, + "pushedBy": { + "displayName": "XXXXXX", + "url": "", + "_links": { + "avatar": { + "href": "" + } + }, + "id": "", + "uniqueName": "", + "imageUrl": "", + "descriptor": "" + }, + "pushId": 37, + "date": "2023-07-23T10:32:35.4167107Z", + "url": "", + "_links": { + "self": { + "href": "" + }, + "repository": { + "href": "" + }, + "commits": { + "href": "" + }, + "pusher": { + "href": "" + }, + "refs": { + "href": "" + } + } +} \ No newline at end of file diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/commit_list.json b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/commit_list.json new file mode 100644 index 000000000000..1b78dc199589 --- /dev/null +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/commit_list.json @@ -0,0 +1,26 @@ +{ + "count": 1, + "value": [ + { + "author": { + "date": "", + "email": "", + "name": "" + }, + "changeCounts": { + "Add": 1, + "Delete": 0, + "Edit": 3 + }, + "comment": "TEST", + "commitId": "", + "committer": { + "date": "", + "email": "", + "name": "" + }, + "remoteUrl": "", + "url": "" + } + ] +} \ No newline at end of file diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/file.json b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/file.json new file mode 100644 index 000000000000..ba99a0691cf4 --- /dev/null +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/file.json @@ -0,0 +1,85 @@ +{ + "commits": [ + { + "treeId": "", + "commitId": "", + "author": { + "name": "", + "email": "", + "date": "2023-07-18T08:35:20Z" + }, + "committer": { + "name": "", + "email": "", + "date": "2023-07-18T08:35:20Z" + }, + "comment": "Test 5.", + "parents": [ + "" + ], + "url": "" + } + ], + "refUpdates": [ + { + "repositoryId": "", + "name": "", + "oldObjectId": "", + "newObjectId": "" + } + ], + "repository": { + "id": "", + "name": "DevOpsDemo", + "url": "", + "project": { + "id": "", + "name": "DevOpsDemo", + "description": "Demo project for Azure DevOps instance", + "url": "", + "state": "wellFormed", + "revision": 27, + "visibility": "private", + "lastUpdateTime": "2022-01-31T12:18:37.09Z" + }, + "size": 0, + "remoteUrl": "", + "sshUrl": "", + "webUrl": "", + "isDisabled": "false", + "isInMaintenance": "false" + }, + "pushedBy": { + "displayName": "", + "url": "", + "_links": { + "avatar": { + "href": "" + } + }, + "id": "", + "uniqueName": "", + "imageUrl": "", + "descriptor": "" + }, + "pushId": 27, + "date": "2023-07-18T08:35:20.3674731Z", + "url": "", + "_links": { + "self": { + "href": "" + }, + "repository": { + "href": "" + }, + "commits": { + "href": "" + }, + "pusher": { + "href": "" + }, + "refs": { + "href": "" + } + } +} \ No newline at end of file diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/file_list.json b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/file_list.json new file mode 100644 index 000000000000..da993ed497cc --- /dev/null +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/file_list.json @@ -0,0 +1,24 @@ +{ + "count": 2, + "value": [ + { + "objectId": "", + "gitObjectType": "tree", + "commitId": "", + "path": "/", + "isFolder": "true", + "contentMetadata": { + "fileName": "" + }, + "url": "" + }, + { + "objectId": "", + "gitObjectType": "tree", + "commitId": "", + "path": "/.github", + "isFolder": "true", + "url": "" + } + ] +} \ No newline at end of file diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/list_reviewers_pull_request.json b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/list_reviewers_pull_request.json new file mode 100644 index 000000000000..0aa912e9d9ca --- /dev/null +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/list_reviewers_pull_request.json @@ -0,0 +1,22 @@ +{ + "count": 1, + "value": [ + { + "_links": { + "avatar": { + "href": "" + } + }, + "displayName": "", + "hasDeclined": false, + "id": "", + "imageUrl": "", + "isContainer": true, + "isFlagged": false, + "reviewerUrl": "", + "uniqueName": "", + "url": "", + "vote": 0 + } + ] +} \ No newline at end of file diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/project_team_list.json b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/project_team_list.json new file mode 100644 index 000000000000..d6b0b3230f4c --- /dev/null +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/project_team_list.json @@ -0,0 +1,14 @@ +{ + "value": [ + { + "id": "", + "name": "DevOpsDemo Team", + "url": "", + "description": "The default project team.", + "identityUrl": "", + "projectName": "DevOpsDemo", + "projectId": "" + } + ], + "count": 1 +} \ No newline at end of file diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/pull_request_commit_list.json b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/pull_request_commit_list.json new file mode 100644 index 000000000000..7f2de62cd131 --- /dev/null +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/pull_request_commit_list.json @@ -0,0 +1,20 @@ +{ + "count": 1, + "value": [ + { + "author": { + "date": "", + "email": "", + "name": "" + }, + "comment": "", + "commitId": "", + "committer": { + "date": "", + "email": "", + "name": "" + }, + "url": "" + } + ] +} \ No newline at end of file diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/pull_request_not_found.json b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/pull_request_not_found.json new file mode 100644 index 000000000000..8123628b260d --- /dev/null +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/pull_request_not_found.json @@ -0,0 +1,10 @@ +{ + "$id": "1", + "innerException": "", + "message": "TF401180: The requested pull request was not found.", + "typeName": "Microsoft.TeamFoundation.Git.Server.GitPullRequestNotFoundException, Microsoft.TeamFoundation.Git.Server", + "typeKey": "GitPullRequestNotFoundException", + "errorCode": 0, + "eventId": 3000, + "value": "" +} \ No newline at end of file diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/pull_request_reviewer_create.json b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/pull_request_reviewer_create.json new file mode 100644 index 000000000000..76cd8fb408f8 --- /dev/null +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/pull_request_reviewer_create.json @@ -0,0 +1,33 @@ +{ + "_links": { + "avatar": { + "href": "" + } + }, + "displayName": "TEST", + "hasDeclined": false, + "id": "TEST", + "imageUrl": "", + "isFlagged": false, + "reviewerUrl": "", + "uniqueName": "", + "url": "", + "vote": 0, + "votedFor": [ + { + "_links": { + "avatar": { + "href": "" + } + }, + "displayName": "", + "id": "", + "imageUrl": "", + "isContainer": true, + "reviewerUrl": "", + "uniqueName": "", + "url": "", + "vote": 0 + } + ] +} \ No newline at end of file diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/pull_request_thread_create.json b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/pull_request_thread_create.json new file mode 100644 index 000000000000..af7831b0f845 --- /dev/null +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/pull_request_thread_create.json @@ -0,0 +1,57 @@ +{ + "pullRequestThreadContext": "None", + "id": 65, + "publishedDate": "2023-07-23T13:30:20.357Z", + "lastUpdatedDate": "2023-07-23T13:30:20.357Z", + "comments": [ + { + "id": 1, + "parentCommentId": 0, + "author": { + "displayName": "XXXXXX", + "url": "", + "_links": { + "avatar": { + "href": "" + } + }, + "id": "", + "uniqueName": "", + "imageUrl": "", + "descriptor": "" + }, + "content": "TEST", + "publishedDate": "2023-07-23T13:30:20.357Z", + "lastUpdatedDate": "2023-07-23T13:30:20.357Z", + "lastContentUpdatedDate": "2023-07-23T13:30:20.357Z", + "commentType": "text", + "_links": { + "self": { + "href": "" + }, + "repository": { + "href": "" + }, + "threads": { + "href": "" + }, + "pullRequests": { + "href": "" + } + } + } + ], + "status": "active", + "threadContext": "None", + "properties": "None", + "identities": "None", + "isDeleted": "false", + "_links": { + "self": { + "href": "" + }, + "repository": { + "href": "" + } + } +} \ No newline at end of file diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/pull_request_thread_list.json b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/pull_request_thread_list.json new file mode 100644 index 000000000000..cda05c063325 --- /dev/null +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/pull_request_thread_list.json @@ -0,0 +1,70 @@ +{ + "value": [ + { + "pullRequestThreadContext": "None", + "id": 66, + "publishedDate": "2023-07-23T20:08:57.74Z", + "lastUpdatedDate": "2023-07-24T07:02:36.89Z", + "comments": [ + { + "id": 1, + "parentCommentId": 0, + "author": { + "displayName": "XXX", + "url": "", + "_links": { + "avatar": { + "href": "" + } + }, + "id": "", + "uniqueName": "", + "imageUrl": "", + "descriptor": "" + }, + "content": "123", + "publishedDate": "2023-07-23T20:08:57.74Z", + "lastUpdatedDate": "2023-07-23T20:08:57.74Z", + "lastContentUpdatedDate": "2023-07-23T20:08:57.74Z", + "commentType": "text", + "usersLiked": [], + "_links": {} + }, + { + "id": 2, + "parentCommentId": 0, + "author": { + "displayName": "XXX", + "url": "", + "_links": {}, + "id": "", + "uniqueName": "", + "imageUrl": "", + "descriptor": "" + }, + "content": "111", + "publishedDate": "2023-07-23T20:11:30.633Z", + "lastUpdatedDate": "2023-07-23T20:11:30.633Z", + "lastContentUpdatedDate": "2023-07-23T20:11:30.633Z", + "commentType": "text", + "usersLiked": [], + "_links": {} + } + ], + "status": "active", + "threadContext": "None", + "properties": "None", + "identities": "None", + "isDeleted": "False", + "_links": { + "self": { + "href": "" + }, + "repository": { + "href": "" + } + } + } + ], + "count": 1 +} \ No newline at end of file diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/pull_request_thread_update.json b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/pull_request_thread_update.json new file mode 100644 index 000000000000..cbf44e9f5e82 --- /dev/null +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/pull_request_thread_update.json @@ -0,0 +1,57 @@ +{ + "pullRequestThreadContext": "None", + "id": 66, + "publishedDate": "2023-07-23T20:08:57.74Z", + "lastUpdatedDate": "2023-07-23T20:12:44.327Z", + "comments": [ + { + "id": 3, + "parentCommentId": 0, + "author": { + "displayName": "XXXXXXX", + "url": "", + "_links": { + "avatar": { + "href": "" + } + }, + "id": "", + "uniqueName": "", + "imageUrl": "", + "descriptor": "" + }, + "content": "111", + "publishedDate": "2023-07-23T20:12:44.327Z", + "lastUpdatedDate": "2023-07-23T20:12:44.327Z", + "lastContentUpdatedDate": "2023-07-23T20:12:44.327Z", + "commentType": "text", + "_links": { + "self": { + "href": "" + }, + "repository": { + "href": "" + }, + "threads": { + "href": "" + }, + "pullRequests": { + "href": "" + } + } + } + ], + "status": "active", + "threadContext": "None", + "properties": "None", + "identities": "None", + "isDeleted": "false", + "_links": { + "self": { + "href": "" + }, + "repository": { + "href": "" + } + } +} \ No newline at end of file diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/response_content b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/response_content new file mode 100644 index 000000000000..5151b874a88b --- /dev/null +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/response_content @@ -0,0 +1 @@ +b'{"objectId":"","size":17,"url":"","_links":{"self":{"href":""},"repository":{"href":""}}}' \ No newline at end of file diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/team_member_list.json b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/team_member_list.json new file mode 100644 index 000000000000..2b6668f92861 --- /dev/null +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/team_member_list.json @@ -0,0 +1,36 @@ +{ + "value": [ + { + "isTeamAdmin": true, + "identity": { + "displayName": "XXX", + "url": "", + "_links": { + "avatar": { + "href": "" + } + }, + "id": "", + "uniqueName": "", + "imageUrl": "", + "descriptor": "" + } + }, + { + "identity": { + "displayName": "YYY", + "url": "", + "_links": { + "avatar": { + "href": "" + } + }, + "id": "", + "uniqueName": "", + "imageUrl": "", + "descriptor": "" + } + } + ], + "count": 2 +} \ No newline at end of file diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/work_item_create.json b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/work_item_create.json new file mode 100644 index 000000000000..2dae3bba4f9b --- /dev/null +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/work_item_create.json @@ -0,0 +1,68 @@ +{ + "id": 20, + "rev": 1, + "fields": { + "System.AreaPath": "DevOpsDemo", + "System.TeamProject": "DevOpsDemo", + "System.IterationPath": "DevOpsDemo", + "System.WorkItemType": "Epic", + "System.State": "To Do", + "System.Reason": "Added to backlog", + "System.CreatedDate": "2023-07-17T11:56:15.927Z", + "System.CreatedBy": { + "displayName": "", + "url": "", + "_links": { + "avatar": { + "href": "" + } + }, + "id": "", + "uniqueName": "", + "imageUrl": "", + "descriptor": "" + }, + "System.ChangedDate": "2023-07-17T11:56:15.927Z", + "System.ChangedBy": { + "displayName": "", + "url": "", + "_links": { + "avatar": { + "href": "" + } + }, + "id": "", + "uniqueName": "", + "imageUrl": "", + "descriptor": "" + }, + "System.CommentCount": 0, + "System.Title": "Test Epic", + "Microsoft.VSTS.Common.StateChangeDate": "2023-07-17T11:56:15.927Z", + "Microsoft.VSTS.Common.Priority": 2 + }, + "_links": { + "self": { + "href": "" + }, + "workItemUpdates": { + "href": "" + }, + "workItemRevisions": { + "href": "" + }, + "workItemComments": { + "href": "" + }, + "html": { + "href": "" + }, + "workItemType": { + "href": "" + }, + "fields": { + "href": "" + } + }, + "url": "" +} \ No newline at end of file diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/work_item_get.json b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/work_item_get.json new file mode 100644 index 000000000000..774f69d199eb --- /dev/null +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/work_item_get.json @@ -0,0 +1,93 @@ +{ + "id": 12, + "rev": 7, + "fields": { + "System.AreaPath": "DevOpsDemo", + "System.TeamProject": "DevOpsDemo", + "System.IterationPath": "DevOpsDemo", + "System.WorkItemType": "Issue", + "System.State": "To Do", + "System.Reason": "Added to backlog", + "System.AssignedTo": { + "displayName": "", + "url": "", + "_links": { + "avatar": { + "href": "" + } + }, + "id": "", + "uniqueName": "", + "imageUrl": "", + "descriptor": "" + }, + "System.CreatedDate": "2023-06-27T12:16:04.84Z", + "System.CreatedBy": { + "displayName": "", + "url": "", + "_links": { + "avatar": { + "href": "" + } + }, + "id": "", + "uniqueName": "", + "imageUrl": "", + "descriptor": "" + }, + "System.ChangedDate": "2023-06-27T20:08:38.163Z", + "System.ChangedBy": { + "displayName": "", + "url": "", + "_links": { + "avatar": { + "href": "" + } + }, + "id": "", + "uniqueName": "", + "imageUrl": "", + "descriptor": "" + }, + "System.CommentCount": 3, + "System.Title": "DevOpsDemo", + "System.BoardColumn": "To Do", + "System.BoardColumnDone": "False", + "Microsoft.VSTS.Common.StateChangeDate": "2023-06-27T12:16:04.84Z", + "Microsoft.VSTS.Common.Priority": 3, + "WEF_0938B27D5E14432786F0BDB8D1CE0AE4_Kanban.Column": "To Do", + "WEF_0938B27D5E14432786F0BDB8D1CE0AE4_Kanban.Column.Done": "False", + "System.Description": "test test test", + "System.History": "Comment for example", + "System.Tags": "test2" + }, + "commentVersionRef": { + "commentId": "", + "version": 1, + "url": "" + }, + "_links": { + "self": { + "href": "" + }, + "workItemUpdates": { + "href": "" + }, + "workItemRevisions": { + "href": "" + }, + "workItemComments": { + "href": "" + }, + "html": { + "href": "" + }, + "workItemType": { + "href": "" + }, + "fields": { + "href": "" + } + }, + "url": "" +} \ No newline at end of file diff --git a/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/work_item_update.json b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/work_item_update.json new file mode 100644 index 000000000000..5c37f37b8186 --- /dev/null +++ b/Packs/AzureDevOps/Integrations/AzureDevOps/test_data/work_item_update.json @@ -0,0 +1,97 @@ +{ + "id": 21, + "rev": 5, + "fields": { + "System.AreaPath": "DevOpsDemo", + "System.TeamProject": "DevOpsDemo", + "System.IterationPath": "DevOpsDemo", + "System.WorkItemType": "Task", + "System.State": "Doing", + "System.Reason": "Started", + "System.AssignedTo": { + "displayName": "", + "url": "", + "_links": { + "avatar": { + "href": "" + } + }, + "id": "", + "uniqueName": "", + "imageUrl": "", + "descriptor": "" + }, + "System.CreatedDate": "2023-07-17T13:11:41.573Z", + "System.CreatedBy": { + "displayName": "", + "url": "", + "_links": { + "avatar": { + "href": "" + } + }, + "id": "", + "uniqueName": "", + "imageUrl": "", + "descriptor": "" + }, + "System.ChangedDate": "2023-07-17T13:22:46.127Z", + "System.ChangedBy": { + "displayName": "", + "url": "", + "_links": { + "avatar": { + "href": "" + } + }, + "id": "", + "uniqueName": "", + "imageUrl": "", + "descriptor": "" + }, + "System.CommentCount": 0, + "System.Title": "Test", + "Microsoft.VSTS.Common.StateChangeDate": "2023-07-17T13:13:50.61Z", + "Microsoft.VSTS.Common.ActivatedDate": "2023-07-17T13:13:50.61Z", + "Microsoft.VSTS.Common.ActivatedBy": { + "displayName": "", + "url": "", + "_links": { + "avatar": { + "href": "" + } + }, + "id": "", + "uniqueName": "", + "imageUrl": "", + "descriptor": "" + }, + "Microsoft.VSTS.Common.Priority": 2, + "System.Description": "", + "System.Tags": "" + }, + "_links": { + "self": { + "href": "" + }, + "workItemUpdates": { + "href": "" + }, + "workItemRevisions": { + "href": "" + }, + "workItemComments": { + "href": "" + }, + "html": { + "href": "" + }, + "workItemType": { + "href": "" + }, + "fields": { + "href": "" + } + }, + "url": "" +} \ No newline at end of file diff --git a/Packs/AzureDevOps/ReleaseNotes/1_3_0.md b/Packs/AzureDevOps/ReleaseNotes/1_3_0.md new file mode 100644 index 000000000000..d5f6a36e1bc3 --- /dev/null +++ b/Packs/AzureDevOps/ReleaseNotes/1_3_0.md @@ -0,0 +1,27 @@ + +#### Integrations + +##### AzureDevOps + +- Added the following commands. + - ***azure-devops-pull-request-reviewer-list***. + - ***azure-devops-pull-request-reviewer-add***. + - ***azure-devops-pull-request-commit-list***. + - ***azure-devops-commit-list***. + - ***azure-devops-commit-get***. + - ***azure-devops-work-item-get***. + - ***azure-devops-work-item-create***. + - ***azure-devops-work-item-update***. + - ***azure-devops-file-create***. + - ***azure-devops-file-update***. + - ***azure-devops-file-delete***. + - ***azure-devops-file-list***. + - ***azure-devops-file-get***. + - ***azure-devops-branch-create***. + - ***azure-devops-pull-request-thread-create***. + - ***azure-devops-pull-request-thread-update***. + - ***azure-devops-pull-request-thread-list***. + - ***azure-devops-project-team-list***. + - ***azure-devops-team-member-list***. + - ***azure-devops-blob-zip-get***. +- Updated the Docker image to: *demisto/crypto:1.0.0.68914*. diff --git a/Packs/AzureDevOps/pack_metadata.json b/Packs/AzureDevOps/pack_metadata.json index 6d94d929c2f2..c4dab7487b62 100644 --- a/Packs/AzureDevOps/pack_metadata.json +++ b/Packs/AzureDevOps/pack_metadata.json @@ -2,7 +2,7 @@ "name": "AzureDevOps", "description": "Create and manage Git repositories in Azure DevOps Services.", "support": "xsoar", - "currentVersion": "1.2.17", + "currentVersion": "1.3.0", "author": "Cortex XSOAR", "url": "https://www.paloaltonetworks.com/cortex", "email": "", diff --git a/Packs/ContentManagement/IncidentFields/incidentfield-AzureDevOpsTargetRef.json b/Packs/ContentManagement/IncidentFields/incidentfield-AzureDevOpsTargetRef.json new file mode 100644 index 000000000000..1df5cedeedb5 --- /dev/null +++ b/Packs/ContentManagement/IncidentFields/incidentfield-AzureDevOpsTargetRef.json @@ -0,0 +1,28 @@ +{ + "id": "incident_cicdazuredevopstargetref", + "version": -1, + "modified": "2023-08-14T11:37:08.742021056Z", + "name": "CICD Azure DevOps target ref", + "ownerOnly": false, + "cliName": "cicdazuredevopstargetref", + "type": "shortText", + "closeForm": false, + "editForm": true, + "required": false, + "neverSetAsRequired": false, + "isReadOnly": false, + "useAsKpi": false, + "locked": false, + "system": false, + "content": true, + "group": 0, + "hidden": false, + "openEnded": false, + "associatedToAll": true, + "unmapped": false, + "unsearchable": true, + "caseInsensitive": true, + "sla": 0, + "threshold": 72, + "fromVersion": "6.9.0" +} \ No newline at end of file diff --git a/Packs/ContentManagement/IncidentFields/incidentfield-ConfigurationFileSource.json b/Packs/ContentManagement/IncidentFields/incidentfield-ConfigurationFileSource.json index cf8af113a1ac..7e764db9d25b 100644 --- a/Packs/ContentManagement/IncidentFields/incidentfield-ConfigurationFileSource.json +++ b/Packs/ContentManagement/IncidentFields/incidentfield-ConfigurationFileSource.json @@ -14,7 +14,8 @@ "selectValues": [ "Attachment", "GitHub", - "Gitlab" + "Gitlab", + "AzureDevOps" ], "useAsKpi": false, "locked": false, diff --git a/Packs/ContentManagement/IncidentFields/incidentfield-CustomPacksSource.json b/Packs/ContentManagement/IncidentFields/incidentfield-CustomPacksSource.json index e8fbaf805d4c..e76293153015 100644 --- a/Packs/ContentManagement/IncidentFields/incidentfield-CustomPacksSource.json +++ b/Packs/ContentManagement/IncidentFields/incidentfield-CustomPacksSource.json @@ -16,6 +16,7 @@ "Google Cloud Storage", "AWS S3", "HTTP request", + "AzureDevOps", "No Custom Packs" ], "useAsKpi": false, diff --git a/Packs/ContentManagement/IncidentFields/incidentfield-Reviewer.json b/Packs/ContentManagement/IncidentFields/incidentfield-Reviewer.json index 428c09d964f9..6950d56cf141 100644 --- a/Packs/ContentManagement/IncidentFields/incidentfield-Reviewer.json +++ b/Packs/ContentManagement/IncidentFields/incidentfield-Reviewer.json @@ -7,7 +7,7 @@ "cliName": "cicdreviewer", "closeForm": false, "content": true, - "description": "For Github - username to set as pull request reviewer. For Bitbucket - account_id to set as pull request reviewer. in order to get the account_id please use the command !bitbucket-workspace-member-list.", + "description": "For Github - username to set as pull request reviewer. For Bitbucket - account_id to set as pull request reviewer. in order to get the account_id please use the command !bitbucket-workspace-member-list. For Azure DevOps - user_id to set as pull request reviewer. In order to get the user_id please use the command !azure-devops-user-list", "editForm": true, "group": 0, "hidden": false, diff --git a/Packs/ContentManagement/Layouts/layoutscontainer-Pull_Request_Creation.json b/Packs/ContentManagement/Layouts/layoutscontainer-Pull_Request_Creation.json index e78b6c06dcb5..1ba3ac5a65af 100644 --- a/Packs/ContentManagement/Layouts/layoutscontainer-Pull_Request_Creation.json +++ b/Packs/ContentManagement/Layouts/layoutscontainer-Pull_Request_Creation.json @@ -372,7 +372,11 @@ { "fieldId": "incident_cicdpullrequestcomment", "isVisible": true - } + }, + { + "fieldId": "incident_cicdazuredevopstargetref", + "isVisible": true + } ], "isVisible": true, "name": "Pull Request details", diff --git a/Packs/ContentManagement/Playbooks/playbook-Configuration_Setup.yml b/Packs/ContentManagement/Playbooks/playbook-Configuration_Setup.yml index 044f133d47a7..23e8f546ff80 100644 --- a/Packs/ContentManagement/Playbooks/playbook-Configuration_Setup.yml +++ b/Packs/ContentManagement/Playbooks/playbook-Configuration_Setup.yml @@ -8,10 +8,10 @@ starttaskid: '0' tasks: '0': id: '0' - taskid: 56a47cd0-a894-45ca-86e0-3789bb3971f9 + taskid: e9943e82-1c94-4cbb-842d-644a3a279c8b type: start task: - id: 56a47cd0-a894-45ca-86e0-3789bb3971f9 + id: e9943e82-1c94-4cbb-842d-644a3a279c8b description: Start Task version: -1 name: '' @@ -24,7 +24,7 @@ tasks: view: |- { "position": { - "x": 480, + "x": 817.5, "y": 50 } } @@ -35,12 +35,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '2': id: '2' - taskid: 70090998-8edf-4e41-8fe2-a07ea531cda6 + taskid: 9f21d25f-494c-4d00-847f-9e67a756f271 type: regular task: - id: 70090998-8edf-4e41-8fe2-a07ea531cda6 + id: 9f21d25f-494c-4d00-847f-9e67a756f271 version: -1 name: Configuration Setup with File description: Configuration loader for the content management pack. @@ -69,8 +70,8 @@ tasks: view: |- { "position": { - "x": 50, - "y": 370 + "x": 275, + "y": 545 } } note: false @@ -80,12 +81,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '3': id: '3' - taskid: f565187c-1885-43fa-8e28-8074da0d36e7 + taskid: 9601942d-9f19-45d6-888e-64df4be4e1d4 type: title task: - id: f565187c-1885-43fa-8e28-8074da0d36e7 + id: 9601942d-9f19-45d6-888e-64df4be4e1d4 version: -1 description: DONE name: DONE @@ -96,8 +98,8 @@ tasks: view: |- { "position": { - "x": 527.5, - "y": 3060 + "x": 275, + "y": 3050 } } note: false @@ -107,12 +109,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '5': id: '5' - taskid: b468ef52-00b3-45c2-8a03-8fc321a97f7a + taskid: 406ae7b2-b2cf-41f5-8b3a-8f6769214647 type: regular task: - id: b468ef52-00b3-45c2-8a03-8fc321a97f7a + id: 406ae7b2-b2cf-41f5-8b3a-8f6769214647 version: -1 name: Set Custom Packs Installed field description: Changes the properties of an incident. @@ -130,7 +133,7 @@ tasks: view: |- { "position": { - "x": 1220, + "x": 1145, "y": 2030 } } @@ -141,12 +144,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '6': id: '6' - taskid: a6a6d0f2-5ee2-4df7-836a-55b2d0b64b1c + taskid: 741b19d0-9d70-4f52-8974-12bcdd53e26f type: regular task: - id: a6a6d0f2-5ee2-4df7-836a-55b2d0b64b1c + id: 741b19d0-9d70-4f52-8974-12bcdd53e26f version: -1 name: Set Marketplace Packs Installed field description: Changes the properties of an incident. @@ -164,7 +168,7 @@ tasks: view: |- { "position": { - "x": 1022.5, + "x": 1257.5, "y": 1185 } } @@ -175,12 +179,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '7': id: '7' - taskid: b3e084ec-bcc9-4ebf-809f-b325f474a217 + taskid: 615f0c17-3111-4268-8e66-6597c2aba1ee type: regular task: - id: b3e084ec-bcc9-4ebf-809f-b325f474a217 + id: 615f0c17-3111-4268-8e66-6597c2aba1ee version: -1 name: Set Lists Created field description: Changes the properties of an incident. @@ -198,8 +203,8 @@ tasks: view: |- { "position": { - "x": 147.5, - "y": 2010 + "x": 275, + "y": 2030 } } note: false @@ -209,12 +214,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '8': id: '8' - taskid: ae17aef1-b139-4f96-8539-73cf2e27f008 + taskid: 11ad1b24-e946-46e8-86be-47bc13fe01ef type: regular task: - id: ae17aef1-b139-4f96-8539-73cf2e27f008 + id: 11ad1b24-e946-46e8-86be-47bc13fe01ef version: -1 name: Set Jobs Created field description: Changes the properties of an incident. @@ -232,8 +238,8 @@ tasks: view: |- { "position": { - "x": 640, - "y": 2710 + "x": 387.5, + "y": 2700 } } note: false @@ -243,12 +249,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '10': id: '10' - taskid: 2845d11d-c192-4747-8fd3-e7addeb59871 + taskid: c3f55b02-a309-4152-827a-e8d91f584832 type: regular task: - id: 2845d11d-c192-4747-8fd3-e7addeb59871 + id: c3f55b02-a309-4152-827a-e8d91f584832 version: -1 name: Download Custom Packs from Google Cloud Storage description: Retrieves object data into a file. @@ -266,8 +273,8 @@ tasks: view: |- { "position": { - "x": 930, - "y": 1700 + "x": 1380, + "y": 1680 } } note: false @@ -277,12 +284,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '11': id: '11' - taskid: fe44aea6-1d68-4c78-8540-a5efdef8e35c + taskid: 282cc2c5-ba58-4902-8f86-be0b3c7be241 type: title task: - id: fe44aea6-1d68-4c78-8540-a5efdef8e35c + id: 282cc2c5-ba58-4902-8f86-be0b3c7be241 version: -1 description: Install Custom Packs name: Install Custom Packs @@ -296,7 +304,7 @@ tasks: view: |- { "position": { - "x": 1022.5, + "x": 1257.5, "y": 1360 } } @@ -307,12 +315,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '12': id: '12' - taskid: 40f6accf-f21b-4600-8250-15967d864f0d + taskid: a8ae8502-204f-4dd0-8eb1-88ebf0f43f99 type: regular task: - id: 40f6accf-f21b-4600-8250-15967d864f0d + id: a8ae8502-204f-4dd0-8eb1-88ebf0f43f99 version: -1 name: Install Custom Packs description: Custom packs installer for the content management pack. @@ -335,8 +344,8 @@ tasks: view: |- { "position": { - "x": 1220, - "y": 1870 + "x": 1145, + "y": 1855 } } note: false @@ -346,12 +355,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '13': id: '13' - taskid: 2135c722-279a-41f1-86b8-3a91d3351cc3 + taskid: c45b464c-5b4c-459e-85e6-5ed62d323952 type: title task: - id: 2135c722-279a-41f1-86b8-3a91d3351cc3 + id: c45b464c-5b4c-459e-85e6-5ed62d323952 version: -1 name: Install Marketplace Packs description: Install Marketplace Packs @@ -365,7 +375,7 @@ tasks: view: |- { "position": { - "x": 1022.5, + "x": 1257.5, "y": 865 } } @@ -376,12 +386,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '14': id: '14' - taskid: f79ad792-f32e-45e2-8801-9ffc97e1685a + taskid: f7b3e6ac-0d49-4dc0-86b7-870081b8e7a2 type: regular task: - id: f79ad792-f32e-45e2-8801-9ffc97e1685a + id: f7b3e6ac-0d49-4dc0-86b7-870081b8e7a2 version: -1 name: Install Marketplace Packs description: Content packs installer from marketplace. @@ -408,7 +419,7 @@ tasks: view: |- { "position": { - "x": 1022.5, + "x": 1257.5, "y": 1010 } } @@ -419,12 +430,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '15': id: '15' - taskid: 0850e0e3-60e0-4a41-8339-040874f1f3ed + taskid: 21b4129b-1e08-479e-8207-4242d4a7761f type: title task: - id: 0850e0e3-60e0-4a41-8339-040874f1f3ed + id: 21b4129b-1e08-479e-8207-4242d4a7761f version: -1 name: Configure Lists description: Configure the lists @@ -449,12 +461,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '17': id: '17' - taskid: 63d6392e-96a5-4aeb-8a03-ec7e9cdd1e1e + taskid: 870c0dc7-2373-432b-8e99-8da71c1f88a6 type: title task: - id: 63d6392e-96a5-4aeb-8a03-ec7e9cdd1e1e + id: 870c0dc7-2373-432b-8e99-8da71c1f88a6 version: -1 name: Configure Jobs description: Configure the jobs @@ -468,8 +481,8 @@ tasks: view: |- { "position": { - "x": 527.5, - "y": 2215 + "x": 275, + "y": 2205 } } note: false @@ -479,12 +492,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '18': id: '18' - taskid: c2ae399f-b45c-4b1c-8f16-a43ab45a03fb + taskid: 8178f98e-2f65-4f6e-828d-f14a9c530275 type: regular task: - id: c2ae399f-b45c-4b1c-8f16-a43ab45a03fb + id: 8178f98e-2f65-4f6e-828d-f14a9c530275 version: -1 name: Create Jobs description: Job creator for the content management pack. @@ -505,8 +519,8 @@ tasks: view: |- { "position": { - "x": 640, - "y": 2535 + "x": 387.5, + "y": 2525 } } note: false @@ -516,12 +530,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '20': id: '20' - taskid: 9ba2b5d4-b0c8-452a-805d-dbe89fd77702 + taskid: e7b83d2a-6ea0-49e5-816f-982ca60a3b29 type: regular task: - id: 9ba2b5d4-b0c8-452a-805d-dbe89fd77702 + id: e7b83d2a-6ea0-49e5-816f-982ca60a3b29 version: -1 name: Create Lists description: List creator for the content management pack. @@ -541,8 +556,8 @@ tasks: view: |- { "position": { - "x": 147.5, - "y": 1860 + "x": 275, + "y": 1855 } } note: false @@ -552,12 +567,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '22': id: '22' - taskid: af67a5f0-6252-43be-8a8d-0fe14fa241d9 + taskid: a9eb82c0-a92a-4a70-8360-a2df237378a6 type: regular task: - id: af67a5f0-6252-43be-8a8d-0fe14fa241d9 + id: a9eb82c0-a92a-4a70-8360-a2df237378a6 version: -1 name: Get Configuration File from GitHub description: Gets the file content from GitHub. @@ -579,7 +595,7 @@ tasks: view: |- { "position": { - "x": 480, + "x": 602.5, "y": 370 } } @@ -590,12 +606,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '23': id: '23' - taskid: 7e57a07a-efc1-4285-8154-3df69e775e3d + taskid: 208ef632-68f8-403f-8a43-5279e820ceb0 type: condition task: - id: 7e57a07a-efc1-4285-8154-3df69e775e3d + id: 208ef632-68f8-403f-8a43-5279e820ceb0 version: -1 name: What is the Source of the Configuration File? description: Determines from where to get the configuration file. @@ -609,6 +626,8 @@ tasks: - '22' Gitlab: - '35' + AzureDevOps: + - "37" separatecontext: false conditions: - label: Attachment @@ -641,10 +660,20 @@ tasks: right: value: simple: Gitlab + - label: AzureDevOps + condition: + - - operator: isEqualString + left: + value: + simple: incident.configurationfilesource + iscontext: true + right: + value: + simple: AzureDevOps view: |- { "position": { - "x": 480, + "x": 817.5, "y": 195 } } @@ -655,12 +684,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '27': id: '27' - taskid: 8278de62-5015-4d59-8797-a2302fe7d8a5 + taskid: 0ea6c685-9c7b-45a8-8eba-7699bd418212 type: regular task: - id: 8278de62-5015-4d59-8797-a2302fe7d8a5 + id: 0ea6c685-9c7b-45a8-8eba-7699bd418212 version: -1 name: Configuration Setup with InfoFile description: Configuration loader for the content management pack. @@ -676,7 +706,7 @@ tasks: complex: root: InfoFile filters: - - - operator: isEqualString + - - operator: endWith left: value: simple: InfoFile.Name @@ -689,8 +719,8 @@ tasks: view: |- { "position": { - "x": 695, - "y": 545 + "x": 817.5, + "y": 555 } } note: false @@ -700,12 +730,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '28': id: '28' - taskid: a166e331-540f-47d2-89e9-ce4fe4f00f19 + taskid: d88dd0d5-6015-4187-8667-4084d9cae949 type: title task: - id: a166e331-540f-47d2-89e9-ce4fe4f00f19 + id: d88dd0d5-6015-4187-8667-4084d9cae949 version: -1 name: Configurations description: Configurations @@ -720,7 +751,7 @@ tasks: view: |- { "position": { - "x": 480, + "x": 602.5, "y": 720 } } @@ -731,12 +762,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '29': id: '29' - taskid: 0456f874-115d-4951-8cd3-edfcd9e37e83 + taskid: 3ed00ec4-bc72-4b95-84ed-4405fbff6fc0 type: condition task: - id: 0456f874-115d-4951-8cd3-edfcd9e37e83 + id: 3ed00ec4-bc72-4b95-84ed-4405fbff6fc0 version: -1 name: What is the Source of the Custom Packs? description: Determines where to get the custom pack files to install. @@ -754,6 +786,8 @@ tasks: - '10' HTTP request: - '30' + AzureDevOps: + - "38" separatecontext: false conditions: - label: Attachments @@ -796,10 +830,20 @@ tasks: right: value: simple: AWS S3 + - label: AzureDevOps + condition: + - - operator: isEqualString + left: + value: + simple: incident.custompackssource + iscontext: true + right: + value: + simple: AzureDevOps view: |- { "position": { - "x": 1022.5, + "x": 1257.5, "y": 1505 } } @@ -810,12 +854,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '30': id: '30' - taskid: 56b086df-0caf-401f-81df-6a00c2f7074e + taskid: 837a56d4-89e6-4f8e-8970-436c61a3ed83 type: regular task: - id: 56b086df-0caf-401f-81df-6a00c2f7074e + id: 837a56d4-89e6-4f8e-8970-436c61a3ed83 version: -1 name: Download Custom Packs using an HTTP request description: Sends an HTTP request. Returns the response as a JSON file. @@ -837,8 +882,8 @@ tasks: view: |- { "position": { - "x": 1472.5, - "y": 1700 + "x": 1810, + "y": 1680 } } note: false @@ -848,12 +893,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '31': id: '31' - taskid: 4c2f3fac-7aeb-4aac-805f-81f51bc729b1 + taskid: 9053ed23-d1b8-44c0-8bdf-ea10a3af2543 type: condition task: - id: 4c2f3fac-7aeb-4aac-805f-81f51bc729b1 + id: 9053ed23-d1b8-44c0-8bdf-ea10a3af2543 version: -1 name: If there is no source provided, then no custom packs should be installed. description: Checks whether there are custom packs to install when no source is provided. In that case, the playbook will stop with an error. @@ -877,8 +923,8 @@ tasks: view: |- { "position": { - "x": 530, - "y": 1700 + "x": 705, + "y": 2030 } } note: false @@ -888,12 +934,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '32': id: '32' - taskid: cb82ea65-8eca-4fbd-8b91-bcfb2618e137 + taskid: a36d9289-b1bb-49b5-834c-2e3f157d0b29 type: regular task: - id: cb82ea65-8eca-4fbd-8b91-bcfb2618e137 + id: a36d9289-b1bb-49b5-834c-2e3f157d0b29 version: -1 name: closeInvestigation description: Close the current incident @@ -908,8 +955,8 @@ tasks: view: |- { "position": { - "x": 527.5, - "y": 2885 + "x": 275, + "y": 2875 } } note: false @@ -919,12 +966,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '33': id: '33' - taskid: ce7b9c34-e320-4e2b-804a-4f7e243d68e5 + taskid: b0949797-92d4-41b6-8230-81b603eae5b5 type: condition task: - id: ce7b9c34-e320-4e2b-804a-4f7e243d68e5 + id: b0949797-92d4-41b6-8230-81b603eae5b5 version: -1 name: Are there Lists to create? description: Changes the properties of an incident. @@ -959,12 +1007,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '34': id: '34' - taskid: 33a19d8e-4b9d-433e-8d66-6d413841ca69 + taskid: 46fe6bca-5e5d-4ca5-8532-48343509bf5f type: condition task: - id: 33a19d8e-4b9d-433e-8d66-6d413841ca69 + id: 46fe6bca-5e5d-4ca5-8532-48343509bf5f version: -1 name: Are there Jobs to create? description: Changes the properties of an incident. @@ -988,8 +1037,8 @@ tasks: view: |- { "position": { - "x": 527.5, - "y": 2360 + "x": 275, + "y": 2350 } } note: false @@ -999,12 +1048,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '35': id: '35' - taskid: e0d41201-8cd9-4f42-88d9-23ee4419064b + taskid: f471af2f-d303-4f77-86ae-91c1abe94cd3 type: regular task: - id: e0d41201-8cd9-4f42-88d9-23ee4419064b + id: f471af2f-d303-4f77-86ae-91c1abe94cd3 version: -1 name: Get Configuration File From Gitlab description: Get raw file @@ -1030,7 +1080,7 @@ tasks: view: |- { "position": { - "x": 910, + "x": 1032.5, "y": 370 } } @@ -1041,12 +1091,13 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + continueonerrortype: "" '36': id: '36' - taskid: ca4fcf63-517a-4902-8714-fc29a0dcdabf + taskid: 244096d1-8e76-4efd-806c-4ef15d62f860 type: regular task: - id: ca4fcf63-517a-4902-8714-fc29a0dcdabf + id: 244096d1-8e76-4efd-806c-4ef15d62f860 version: -1 name: Download Custom Packs from AWS S3 description: Download a file from S3 bucket to war room. @@ -1066,8 +1117,95 @@ tasks: view: |- { "position": { - "x": 1880, - "y": 1700 + "x": 930, + "y": 1680 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + continueonerrortype: "" + "37": + id: "37" + taskid: afce9a87-3284-4d05-8b25-c7710621687a + type: regular + task: + id: afce9a87-3284-4d05-8b25-c7710621687a + version: -1 + name: Get Configuration File From azureDevOps + description: Get raw file. + script: '|||azure-devops-file-get' + type: regular + iscommand: true + brand: "" + nexttasks: + '#none#': + - "27" + scriptarguments: + branch_name: + complex: + root: incident + accessor: branchname + file_name: + complex: + root: incident + accessor: configfilepath + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 1490, + "y": 370 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "38": + id: "38" + taskid: ef172a7b-5181-48c5-813d-783fdf6e1d7a + type: regular + task: + id: ef172a7b-5181-48c5-813d-783fdf6e1d7a + version: -1 + name: Download Custom Packs from Azure DevOps + description: Retrieves the zip folders which contain the custom packs. + script: '|||azure-devops-file-get' + type: regular + iscommand: true + brand: "" + nexttasks: + '#none#': + - "12" + scriptarguments: + branch_name: + complex: + root: incident + accessor: branchname + file_name: + complex: + root: ConfigurationSetup.CustomPacks + accessor: packurl + format: + simple: zip + include_content: + simple: "True" + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 2230, + "y": 1680 } } note: false @@ -1082,8 +1220,8 @@ view: |- "linkLabelsPosition": {}, "paper": { "dimensions": { - "height": 3075, - "width": 2210, + "height": 3065, + "width": 2560, "x": 50, "y": 50 } @@ -1094,7 +1232,7 @@ inputs: value: {} required: false description: Demisto REST API instance name to use. - playbookInputQuery: null + playbookInputQuery: outputs: [] tests: - No tests (auto formatted) diff --git a/Packs/ContentManagement/Playbooks/playbook-Pull_Request_Creation_-_AzureDevOps.yml b/Packs/ContentManagement/Playbooks/playbook-Pull_Request_Creation_-_AzureDevOps.yml new file mode 100644 index 000000000000..d2d48f5a630b --- /dev/null +++ b/Packs/ContentManagement/Playbooks/playbook-Pull_Request_Creation_-_AzureDevOps.yml @@ -0,0 +1,1195 @@ +id: Pull Request Creation - AzureDevOps +version: -1 +contentitemexportablefields: + contentitemfields: {} +name: Pull Request Creation - AzureDevOps +description: This playbook creates a pull request using the AzureDevOps integration. +starttaskid: "0" +tasks: + "0": + id: "0" + taskid: d86c55cb-ee31-49d1-894b-9381494bc24d + type: start + task: + id: d86c55cb-ee31-49d1-894b-9381494bc24d + version: -1 + name: "" + iscommand: false + brand: "" + description: '' + nexttasks: + '#none#': + - "37" + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 480, + "y": 770 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "3": + id: "3" + taskid: 1667dcd1-af57-4484-8450-856032b0ebd9 + type: regular + task: + id: 1667dcd1-af57-4484-8450-856032b0ebd9 + version: -1 + name: Create new branch + description: Create a branch. + script: '|||azure-devops-branch-create' + type: regular + iscommand: true + brand: "" + nexttasks: + '#none#': + - "53" + scriptarguments: + branch_name: + simple: ${BranchName} + commit_comment: + simple: 'A new branch was created for the PR ' + file_content: + simple: An initial file just to create a new branch. + file_path: + simple: '"create_branch.txt"' + reference_branch_name: + simple: ${inputs.ReferenceBranch} + target_ref: + simple: ${inputs.Azure DevOps target ref} + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": -10, + "y": 2330 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "7": + id: "7" + taskid: f1d03411-efce-48e7-877e-3ba4af958466 + type: regular + task: + id: f1d03411-efce-48e7-877e-3ba4af958466 + version: -1 + name: Create pull request + description: Create a new pull request. + script: '|||azure-devops-pull-request-create' + type: regular + iscommand: true + brand: "" + nexttasks: + '#none#': + - "61" + scriptarguments: + description: + simple: ${PR_text} + reviewers_ids: + complex: + root: ${incident.cicdreviewer} + filters: + - - operator: isNotEmpty + left: + value: + simple: ${incident.cicdreviewer} + iscontext: true + source_branch: + simple: ${BranchName} + target_branch: + simple: refs/heads/master + title: + complex: + root: incident + accessor: cicdpullrequesttitle + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 480, + "y": 3400 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "18": + id: "18" + taskid: ac6b8575-bca4-43a7-88a1-28d659c7d644 + type: regular + task: + id: ac6b8575-bca4-43a7-88a1-28d659c7d644 + version: -1 + name: Get branch list + description: Retrieve the repository branches list. + script: '|||azure-devops-branch-list' + type: regular + iscommand: true + brand: "" + nexttasks: + '#none#': + - "19" + separatecontext: false + continueonerror: true + continueonerrortype: "" + view: |- + { + "position": { + "x": 480, + "y": 2060 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "19": + id: "19" + taskid: 5494b050-aae6-4fbd-8f1a-63e7842bb4b9 + type: condition + task: + id: 5494b050-aae6-4fbd-8f1a-63e7842bb4b9 + version: -1 + name: Does branch exist? + description: Does branch exist? + type: condition + iscommand: false + brand: "" + nexttasks: + '#default#': + - "3" + "yes": + - "54" + separatecontext: false + conditions: + - label: "yes" + condition: + - - operator: endWith + left: + value: + simple: ${AzureDevOps.Branch.name} + iscontext: true + right: + value: + simple: ${BranchName} + iscontext: true + continueonerrortype: "" + view: |- + { + "position": { + "x": 480, + "y": 2235 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "25": + id: "25" + taskid: 6eb1c82f-8fc3-4084-8d18-82946de541f1 + type: regular + task: + id: 6eb1c82f-8fc3-4084-8d18-82946de541f1 + version: -1 + name: Set branch name from CI/CD Branch field + description: Set a value in context under the key you entered. + scriptName: Set + type: regular + iscommand: false + brand: "" + nexttasks: + '#none#': + - "38" + scriptarguments: + key: + simple: BranchName + value: + complex: + root: incident + accessor: cicdbranch + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 480, + "y": 1565 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "26": + id: "26" + taskid: 5990764d-c56e-4c8d-8172-7db6abd8a146 + type: condition + task: + id: 5990764d-c56e-4c8d-8172-7db6abd8a146 + version: -1 + name: Is CI/CD Branch field given + description: Is there a branch name in the update branch field in the incident. + type: condition + iscommand: false + brand: "" + nexttasks: + '#default#': + - "27" + "yes": + - "25" + separatecontext: false + conditions: + - label: "yes" + condition: + - - operator: isNotEmpty + left: + value: + simple: incident.cicdbranch + iscontext: true + right: + value: {} + ignorecase: true + continueonerrortype: "" + view: |- + { + "position": { + "x": 265, + "y": 1215 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "27": + id: "27" + taskid: 0839d33c-4cf0-45fe-8e37-b33d90664284 + type: regular + task: + id: 0839d33c-4cf0-45fe-8e37-b33d90664284 + version: -1 + name: Suggest branch name + description: | + The script gets the pack name as input and suggests an available branch name. For example: + If pack name is "MyPack", the branch name will be "MyPack". + If a branch with the name "MyPack" exists, the script will return "MyPack_1". + scriptName: SuggestBranchName + type: regular + iscommand: false + brand: "" + nexttasks: + '#none#': + - "28" + scriptarguments: + command_get_branch: + simple: bitbucket-branch-get + pack: + simple: ${inputs.PackName} + use_command: + simple: azure-devops-branch-list + separatecontext: false + continueonerror: true + continueonerrortype: errorPath + view: |- + { + "position": { + "x": 50, + "y": 1390 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "28": + id: "28" + taskid: fb5c0ed2-dacb-4dec-84fd-0037151d9afd + type: regular + task: + id: fb5c0ed2-dacb-4dec-84fd-0037151d9afd + version: -1 + name: Set branch name from SuggestBranchName output + description: Set a value in context under the key you entered. + scriptName: Set + type: regular + iscommand: false + brand: "" + nexttasks: + '#none#': + - "38" + scriptarguments: + key: + simple: BranchName + value: + complex: + root: AvailableBranch + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 50, + "y": 1565 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "29": + id: "29" + taskid: 12f1b1dd-ff77-4f10-8685-048ecf3d6c79 + type: condition + task: + id: 12f1b1dd-ff77-4f10-8685-048ecf3d6c79 + version: -1 + name: Is CI/CD Pull Request Branch field given + description: Is there a branch name in the matching field in the CI/CD incident. + type: condition + iscommand: false + brand: "" + nexttasks: + '#default#': + - "26" + "yes": + - "30" + separatecontext: false + conditions: + - label: "yes" + condition: + - - operator: isNotEmpty + left: + value: + simple: incident.cicdpullrequestbranch + iscontext: true + right: + value: {} + ignorecase: true + continueonerrortype: "" + view: |- + { + "position": { + "x": 480, + "y": 1040 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "30": + id: "30" + taskid: d3e2f12a-5a7b-41cc-8839-b0cbaabf1d93 + type: regular + task: + id: d3e2f12a-5a7b-41cc-8839-b0cbaabf1d93 + version: -1 + name: Set branch name from CI/CD Pull Request Branch field + description: Set a value in context under the key you entered. + scriptName: Set + type: regular + iscommand: false + brand: "" + nexttasks: + '#none#': + - "38" + scriptarguments: + key: + simple: BranchName + value: + complex: + root: incident + accessor: cicdpullrequestbranch + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 910, + "y": 1565 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "31": + id: "31" + taskid: 6bf6a356-7f44-4974-8b3a-dcb14ec01655 + type: regular + task: + id: 6bf6a356-7f44-4974-8b3a-dcb14ec01655 + version: -1 + name: Get pull request list + description: Retrieve pull requests in the repository. + script: '|||azure-devops-pull-request-list' + type: regular + iscommand: true + brand: "" + nexttasks: + '#none#': + - "51" + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 807.5, + "y": 3750 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "35": + id: "35" + taskid: bfe46dba-4f81-4a65-803b-63d513b3d8b6 + type: regular + task: + id: bfe46dba-4f81-4a65-803b-63d513b3d8b6 + version: -1 + name: Set MessageText value for update action + description: Set a value in context under the key you entered. + scriptName: Set + type: regular + iscommand: false + brand: "" + scriptarguments: + key: + simple: MessageText + value: + simple: Pull Request ${pr_id} was updated successfully + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 807.5, + "y": 4415 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "36": + id: "36" + taskid: 840e68a3-8fdd-4f5c-88e3-07c740db1af7 + type: regular + task: + id: 840e68a3-8fdd-4f5c-88e3-07c740db1af7 + version: -1 + name: Set MessageText for new pull request + description: Set a value in context under the key you entered. + scriptName: Set + type: regular + iscommand: false + brand: "" + scriptarguments: + key: + simple: MessageText + value: + simple: New pull request was created by ${DemistoUsers.[0].username} for the pack ${PackName} + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 265, + "y": 4080 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "37": + id: "37" + taskid: e5037068-a16a-47ae-8b18-ae26506bd7cb + type: title + task: + id: e5037068-a16a-47ae-8b18-ae26506bd7cb + version: -1 + name: Set the branch name + type: title + iscommand: false + brand: "" + description: '' + nexttasks: + '#none#': + - "29" + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 480, + "y": 925 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "38": + id: "38" + taskid: 2d04a827-86ff-4e0d-8ebe-5055cc6fe6b8 + type: title + task: + id: 2d04a827-86ff-4e0d-8ebe-5055cc6fe6b8 + version: -1 + name: Check if branch exists and create it if not + type: title + iscommand: false + brand: "" + description: '' + nexttasks: + '#none#': + - "18" + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 480, + "y": 1915 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "39": + id: "39" + taskid: f2f57205-580c-43d8-80bf-bc62fa6d5487 + type: title + task: + id: f2f57205-580c-43d8-80bf-bc62fa6d5487 + version: -1 + name: Commit the files + type: title + iscommand: false + brand: "" + description: '' + nexttasks: + '#none#': + - "59" + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 480, + "y": 2585 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "40": + id: "40" + taskid: 077047a3-61f1-4fb0-8211-900642e58874 + type: title + task: + id: 077047a3-61f1-4fb0-8211-900642e58874 + version: -1 + name: Create new pull request + type: title + iscommand: false + brand: "" + description: '' + nexttasks: + '#none#': + - "46" + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 265, + "y": 3080 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "41": + id: "41" + taskid: 8e9586bc-002c-47c9-800f-c36eb09d7699 + type: title + task: + id: 8e9586bc-002c-47c9-800f-c36eb09d7699 + version: -1 + name: Update existing pull request + type: title + iscommand: false + brand: "" + description: '' + nexttasks: + '#none#': + - "31" + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 807.5, + "y": 3590 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "45": + id: "45" + taskid: 7cd990b5-7c1f-41e2-8638-bad73b97385d + type: regular + task: + id: 7cd990b5-7c1f-41e2-8638-bad73b97385d + version: -1 + name: Create pull request with pack name as title + description: Create a new pull request. + script: '|||azure-devops-pull-request-create' + type: regular + iscommand: true + brand: "" + nexttasks: + '#none#': + - "61" + scriptarguments: + description: + simple: ${PR_text} + reviewers_ids: + complex: + root: ${incident.cicdreviewer} + filters: + - - operator: isNotEmpty + left: + value: + simple: ${incident.cicdreviewer} + iscontext: true + source_branch: + simple: ${BranchName} + target_branch: + simple: refs/heads/master + title: + simple: ${inputs.PackName} + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 50, + "y": 3400 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "46": + id: "46" + taskid: 3ee32692-cd01-4a6a-8597-7002eeebca8e + type: condition + task: + id: 3ee32692-cd01-4a6a-8597-7002eeebca8e + version: -1 + name: Is Pull Request title empty? + description: Is the field of the pull request title in the incident empty? + type: condition + iscommand: false + brand: "" + nexttasks: + '#default#': + - "7" + "yes": + - "45" + separatecontext: false + conditions: + - label: "yes" + condition: + - - operator: isEmpty + left: + value: + complex: + root: ${incident + accessor: cicdpullrequesttitle} + iscontext: true + right: + value: {} + ignorecase: true + continueonerrortype: "" + view: |- + { + "position": { + "x": 265, + "y": 3225 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "48": + id: "48" + taskid: bfcb6672-680d-4deb-822c-a220fadb3066 + type: condition + task: + id: bfcb6672-680d-4deb-822c-a220fadb3066 + version: -1 + name: Does branch exist? + description: Does the branch exist? + type: condition + iscommand: false + brand: "" + nexttasks: + '#default#': + - "40" + "yes": + - "41" + separatecontext: false + conditions: + - label: "yes" + condition: + - - operator: isEqualString + left: + value: + complex: + root: IsExistingBranch + iscontext: true + right: + value: + simple: "True" + continueonerrortype: "" + view: |- + { + "position": { + "x": 480, + "y": 2900 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "51": + id: "51" + taskid: 67734944-bae9-4cfb-810f-fa13bfc793b5 + type: regular + task: + id: 67734944-bae9-4cfb-810f-fa13bfc793b5 + version: -1 + name: Find Relevant pull request ID + description: Set a value in context under the key you entered. + scriptName: Set + type: regular + iscommand: false + brand: "" + nexttasks: + '#none#': + - "62" + scriptarguments: + key: + simple: pr_id + value: + complex: + root: AzureDevOps.PullRequest + filters: + - - operator: isEqualString + left: + value: + simple: AzureDevOps.PullRequest.sourceRefName + iscontext: true + right: + value: + simple: ${BranchName} + iscontext: true + accessor: pullRequestId + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 807.5, + "y": 3915 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "52": + id: "52" + taskid: 31828a94-2e35-4c73-8203-079a5a656f99 + type: regular + task: + id: 31828a94-2e35-4c73-8203-079a5a656f99 + version: -1 + name: Update relevant Pull Request + description: 'Update a pull request. At least one of the following arguments must be provided: title, description, or status.' + script: '|||azure-devops-pull-request-update' + type: regular + iscommand: true + brand: "" + nexttasks: + '#none#': + - "35" + scriptarguments: + description: + simple: ${PR_text} + pull_request_id: + simple: ${pr_id} + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 807.5, + "y": 4250 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "53": + id: "53" + taskid: 734bea9f-7747-46c5-802d-7642b5fbb2d3 + type: regular + task: + id: 734bea9f-7747-46c5-802d-7642b5fbb2d3 + version: -1 + name: Set New Branch + description: Set a value in context under the key you entered. + scriptName: Set + type: regular + iscommand: false + brand: "" + nexttasks: + '#none#': + - "39" + scriptarguments: + key: + simple: IsExistingBranch + value: + simple: "False" + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": -10, + "y": 2490 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "54": + id: "54" + taskid: 5f97952d-2994-403e-8200-e0cbcd99ab0b + type: regular + task: + id: 5f97952d-2994-403e-8200-e0cbcd99ab0b + version: -1 + name: Set Existing Branch + description: Set a value in context under the key you entered. + scriptName: Set + type: regular + iscommand: false + brand: "" + nexttasks: + '#none#': + - "39" + scriptarguments: + key: + simple: IsExistingBranch + value: + simple: "True" + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 890, + "y": 2410 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "59": + id: "59" + taskid: 6fa51911-114f-4554-85c5-1199af9aee4b + type: regular + task: + id: 6fa51911-114f-4554-85c5-1199af9aee4b + version: -1 + name: Commit files + description: This script gets content files as input from the context, commits the files in the correct folder and creates the pull request text. + scriptName: CommitFiles + type: regular + iscommand: false + brand: "" + nexttasks: + '#none#': + - "48" + scriptarguments: + branch: + complex: + root: BranchName + comment: + complex: + root: incident + accessor: cicdpullrequestcomment + files: + simple: ${inputs.File} + git_integration: + simple: AzureDevOps + pack: + simple: ${inputs.PackName} + template: + complex: + root: inputs.PullRequestTemplate + user: + complex: + root: DemistoUsers + transformers: + - operator: FirstArrayElement + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 480, + "y": 2720 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "61": + id: "61" + taskid: 58bca60d-47f8-430b-8e03-eae95fdf2cee + type: regular + task: + id: 58bca60d-47f8-430b-8e03-eae95fdf2cee + version: -1 + name: Set pull request ID + description: Set a value in context under the key you entered. + scriptName: Set + type: regular + iscommand: false + brand: "" + nexttasks: + '#none#': + - "36" + scriptarguments: + key: + simple: pr_id + value: + simple: ${AzureDevOps.PullRequest.pullRequestId} + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 265, + "y": 3575 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "62": + id: "62" + taskid: 947bdcf1-1718-4d58-8144-fb4e57c85a52 + type: regular + task: + id: 947bdcf1-1718-4d58-8144-fb4e57c85a52 + version: -1 + name: Delete pull requests list context + description: |- + Delete field from context. + + This automation runs using the default Limited User role, unless you explicitly change the permissions. + For more information, see the section about permissions here: + https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/6.11/Cortex-XSOAR-Administrator-Guide/Automations + scriptName: DeleteContext + type: regular + iscommand: false + brand: "" + nexttasks: + '#none#': + - "52" + scriptarguments: + key: + simple: ${AzureDevOps.PullRequest} + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 807.5, + "y": 4080 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false +view: |- + { + "linkLabelsPosition": {}, + "paper": { + "dimensions": { + "height": 3740, + "width": 1300, + "x": -10, + "y": 770 + } + } + } +inputs: +- key: PullRequestTemplate + value: {} + required: true + description: Pull request description template. + playbookInputQuery: +- key: MainBranch + value: + complex: + root: incident + accessor: cicdbranch + required: false + description: The name of the branch you want the changes pulled into, which must be an existing branch on the current repository. + playbookInputQuery: +- key: PackName + value: {} + required: true + description: The name of the pack + playbookInputQuery: +- key: File + value: {} + required: true + description: The file or files to commit to the new or updated branch or pull request. + playbookInputQuery: +- key: Azure DevOps target ref + value: + complex: + root: incident + accessor: azuredevopstargetref + required: false + description: The reference to create a new branch from. + playbookInputQuery: null +outputs: [] +tests: +- No tests (auto formatted) +fromversion: 6.0.0 diff --git a/Packs/ContentManagement/Playbooks/playbook-Pull_Request_Creation_-_AzureDevOps_README.md b/Packs/ContentManagement/Playbooks/playbook-Pull_Request_Creation_-_AzureDevOps_README.md new file mode 100644 index 000000000000..e07154b9e95d --- /dev/null +++ b/Packs/ContentManagement/Playbooks/playbook-Pull_Request_Creation_-_AzureDevOps_README.md @@ -0,0 +1,41 @@ +This playbook creates a pull request using the Azure DevOps integration. + +## Dependencies +This playbook uses the following sub-playbooks, integrations, and scripts. + +### Sub-playbooks +This playbook does not use any sub-playbooks. + +### Integrations +Azure DevOps + +### Scripts +* SuggestBranchName +* CommitFiles +* Set +* DeleteContext + +### Commands +* azure-devops-branch-list +* azure-devops-branch-create +* azure-devops-pull-request-create +* azure-devops-pull-request-list +* azure-devops-pull-request-update +* azure-devops-file-list +* azure-devops-file-update +* azure-devops-file-create + +## Playbook Inputs +--- + +| **Name** | **Description** | **Default Value** | **Required** | +| --- | --- | --- |--------------| +| PullRequestTemplate | Pull request description template. | | Required | +| MainBranch | The name of the branch you want the changes pulled into, which must be an existing branch on the current repository. | | Optional | +| PackName | The name of the pack. | | Required | +| File | The file or files to commit to the new or updated branch or pull request. | | Required | + +## Playbook Outputs +--- +There are no outputs for this playbook. +Creating a branch (with the azure-devops-branch-create command) creates a new file due to API limitations ("create_branch.txt"). diff --git a/Packs/ContentManagement/Playbooks/playbook-Pull_Request_Creation_-_Generic.yml b/Packs/ContentManagement/Playbooks/playbook-Pull_Request_Creation_-_Generic.yml index ab981607f3fa..a501bcd03279 100644 --- a/Packs/ContentManagement/Playbooks/playbook-Pull_Request_Creation_-_Generic.yml +++ b/Packs/ContentManagement/Playbooks/playbook-Pull_Request_Creation_-_Generic.yml @@ -561,10 +561,10 @@ tasks: continueonerrortype: "" "47": id: "47" - taskid: b4894f8f-75e3-4406-86f3-06500e96ba77 + taskid: 0568e33e-3cce-41b0-8611-a80abe914f91 type: condition task: - id: b4894f8f-75e3-4406-86f3-06500e96ba77 + id: 0568e33e-3cce-41b0-8611-a80abe914f91 version: -1 name: What integration to use for create the pull request description: Check the GitIntegration input to know which git integration we want to use to create the pull request. @@ -580,6 +580,8 @@ tasks: - "49" GitLab: - "53" + AzureDevOps: + - "58" separatecontext: false conditions: - label: github @@ -615,6 +617,16 @@ tasks: right: value: simple: gitlab + - label: AzureDevOps + condition: + - - operator: isEqualString + left: + value: + simple: inputs.GitIntegration + iscontext: true + right: + value: + simple: azuredevops view: |- { "position": { @@ -672,10 +684,10 @@ tasks: continueonerrortype: "" "49": id: "49" - taskid: 0f8941a5-780f-4aec-8b31-f19ab6d3af24 + taskid: e7f96b02-ad82-43c2-8e1c-ad81ca6e4424 type: playbook task: - id: 0f8941a5-780f-4aec-8b31-f19ab6d3af24 + id: e7f96b02-ad82-43c2-8e1c-ad81ca6e4424 version: -1 name: Pull Request Creation - Bitbucket description: This playbook creates a pull request using Bitbucket integration. @@ -861,13 +873,111 @@ tasks: quietmode: 0 isoversize: false isautoswitchedtoquietmode: false + "56": + id: "56" + taskid: d31a006f-21fe-4dff-87a2-33746d1a1c63 + type: regular + task: + id: d31a006f-21fe-4dff-87a2-33746d1a1c63 + version: -1 + name: Set incident fields values + description: |- + Update the following incident fields with the relevant data: + - cicdreviewer + - cicdpullrequestlink + - cicdpackname + - cicdbranch + script: Builtin|||setIncident + type: regular + iscommand: true + brand: Builtin + nexttasks: + '#none#': + - "42" + scriptarguments: + cicdbranch: + complex: + root: BranchName + cicdpackname: + complex: + root: PackName + cicdpullrequestlink: + simple: https://github.com/${GitHub.PR.Head.Repo.FullName}/pull/${GitHub.PR.Number} + cicdreviewer: + complex: + root: GitLab.MergeRequest.reviewers + accessor: account_id + separatecontext: false + continueonerrortype: "" + view: |- + { + "position": { + "x": 1780, + "y": 1390 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false + "58": + id: "58" + taskid: a20e1120-9ea5-4ca4-841a-5c81ca7e2eb5 + type: playbook + task: + id: a20e1120-9ea5-4ca4-841a-5c81ca7e2eb5 + version: -1 + name: Pull Request Creation - AzureDevOps + description: This playbook creates a pull request using the AzureDevOps integration. + playbookName: Pull Request Creation - AzureDevOps + type: playbook + iscommand: false + brand: "" + nexttasks: + '#none#': + - "56" + scriptarguments: + File: + simple: ${File} + MainBranch: + simple: ${inputs.MainBranch} + PackName: + simple: ${PackName} + PullRequestTemplate: + simple: ${inputs.PullRequestTemplate} + AzureDevOpsTargetRef: + simple: ${inputs.AzureDevOpsTargetRef} + separatecontext: false + continueonerrortype: "" + loop: + iscommand: false + exitCondition: "" + wait: 1 + max: 0 + view: |- + { + "position": { + "x": 1780, + "y": 1210 + } + } + note: false + timertriggers: [] + ignoreworker: false + skipunavailable: false + quietmode: 0 + isoversize: false + isautoswitchedtoquietmode: false view: |- { "linkLabelsPosition": {}, "paper": { "dimensions": { "height": 2425, - "width": 1750, + "width": 2190, "x": -30, "y": 50 } @@ -887,17 +997,29 @@ inputs: playbookInputQuery: - key: MainBranch value: - simple: main + simple: ${incident.cicdbranch} required: true description: The name of the branch you want the changes pulled into, which must be an existing branch on the current repository. playbookInputQuery: - key: GitIntegration value: - simple: gitlab + simple: azuredevops required: true - description: Which version control integration to use. We support github, gitlab and bitbucket. + description: Which version control integration to use. We support github, gitlab, bitbucket and azuredevops. + playbookInputQuery: +- key: AzureDevOpsTargetRef + value: + complex: + root: incident + accessor: ${incident.cicdazuredevopstargetref} + required: false + description: Mandatory for Azure DevOps. The reference branch or SHA commit to + create a new branch from. playbookInputQuery: outputs: [] tests: - No tests (auto formatted) fromversion: 6.0.0 +contentitemexportablefields: + contentitemfields: {} +system: true diff --git a/Packs/ContentManagement/ReleaseNotes/1_2_12.md b/Packs/ContentManagement/ReleaseNotes/1_2_12.md new file mode 100644 index 000000000000..bce8610b2d98 --- /dev/null +++ b/Packs/ContentManagement/ReleaseNotes/1_2_12.md @@ -0,0 +1,40 @@ + +#### Incident Fields + +- **Configuration File Source** +- New: **CICD Azure DevOps target ref** +- **Custom Packs Source** +- **CI/CD Pull Request Reviewer** + +#### Layouts + +##### Pull Request Creation + +Added support for the Azure DevOps integration. + +#### Playbooks + +##### New: Pull Request Creation - AzureDevOps + +New: This playbook creates a pull request using the AzureDevOps integration. (Available from Cortex XSOAR 6.9.0). +##### Configuration Setup + +Added support for the Azure DevOps integration. +##### Pull Request Creation - Generic + +Added support for the Azure DevOps integration. + +#### Scripts + +##### CommitFiles + +- Added support for the Azure DevOps integration. +- Updated the Docker image to: *demisto/xsoar-tools:1.0.0.69232*. +##### SuggestBranchName + +- Added support for the Azure DevOps integration. +- Updated the Docker image to: *demisto/python3:3.10.12.68714*. +##### CustomPackInstaller + +- Added support for the Azure DevOps integration. +- Updated the Docker image to: *demisto/xsoar-tools:1.0.0.69232*. diff --git a/Packs/ContentManagement/Scripts/CommitFiles/CommitFiles.py b/Packs/ContentManagement/Scripts/CommitFiles/CommitFiles.py index e8e2e0938049..cfca37f8bd7a 100644 --- a/Packs/ContentManagement/Scripts/CommitFiles/CommitFiles.py +++ b/Packs/ContentManagement/Scripts/CommitFiles/CommitFiles.py @@ -1,10 +1,11 @@ +from pathlib import Path + import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 import os import io from os.path import exists -from typing import Dict from contextlib import redirect_stderr, redirect_stdout from demisto_sdk.commands.split.ymlsplitter import YmlSplitter from demisto_sdk.commands.common.constants import ENTITY_TYPE_TO_DIR @@ -18,7 +19,7 @@ '{}\n\n' \ '---' -file_path_to_sha: Dict[str, str] = {} +file_path_to_sha: dict[str, str] = {} files_path = [] @@ -36,7 +37,7 @@ def __init__(self, pack_name=None, file=None): # read the file from entry id file_object = demisto.getFilePath(file['EntryID']) - with open(file_object['path'], 'r') as f: + with open(file_object['path']) as f: file_contents = f.read() self.file_text = file_contents @@ -133,6 +134,22 @@ def does_file_exist(branch_name: str, content_file: ContentFile) -> bool: return False +def searched_file_path(branch_name: str, content_file: ContentFile) -> bool: + full_path = Path(content_file.path_to_file, content_file.file_name) + + if str(full_path) in files_path: # the files list, check if the file already exists in the list + return True + # try to get the file from branch + response = execute_command('azure-devops-file-list', + args={'branch_name': branch_name.split('/')[-1], 'recursion_level': 'Full'}) + files_set = {file["path"] for file in response.get("value", [])} + for file in files_set: + if str(full_path) in file: + files_path.append(str(full_path)) + return True + return False + + def commit_content_item_bitbucket(branch_name: str, content_file: ContentFile, new_files: List, modified_files: List): commit_args = {"message": f"Added {content_file.file_name}", "file_name": f"{content_file.path_to_file}/{content_file.file_name}", @@ -156,6 +173,45 @@ def commit_content_item_bitbucket(branch_name: str, content_file: ContentFile, n f'{traceback.format_exc()}') +def commit_content_item_azure_devops(branch_name: str, content_file: ContentFile, new_files: List, modified_files: List): + file_args = {"commit_comment": f"{content_file.file_name} was added.", + "file_path": f"{content_file.path_to_file}/{content_file.file_name}", + "branch_name": f"{branch_name}", + "file_content": f"{content_file.file_text}"} + + file_exists = searched_file_path(branch_name, content_file) + + # don't commit pack_metadata.json if already exists in the branch + if file_exists and content_file.file_name == 'pack_metadata.json': + return + response = demisto.executeCommand('azure-devops-branch-list', args={}) + branches_list = response[0].get("Contents", {}).get("value", []) if response and isinstance(response, list) else [] + for branch in branches_list: + if branch["name"] == branch_name: + branch_id = branch["objectId"] + break + else: + raise DemistoException('Failed to find a corresponding branch id to the given branch name.') + file_args["branch_id"] = branch_id + + if file_exists: + # update existing file + file_args['commit_comment'] = f'{content_file.file_name} was updated.' + modified_files.append(content_file.file_name) + command_to_execute = 'azure-devops-file-update' + else: + # new file added + new_files.append(content_file.file_name) + command_to_execute = 'azure-devops-file-create' + + try: + demisto.executeCommand(command_to_execute, args=file_args) + except DemistoException as e: + raise DemistoException( + f'Failed to execute azure-devops-file-update or azure-devops-file-create commands. Error: {e}, ' + ) from e + + def split_yml_file(content_file: ContentFile): # pragma: no cover content_files = [] @@ -186,19 +242,18 @@ def split_yml_file(content_file: ContentFile): # pragma: no cover elif script_type == 'powershell': script_extention = 'ps1' - with redirect_stdout(output_capture): - with redirect_stderr(output_capture): - yml_splitter.extract_to_package_format() + with redirect_stdout(output_capture), redirect_stderr(output_capture): + yml_splitter.extract_to_package_format() yml_file_path = f'{base_name}/{base_name}.yml' script_file_path = f'{base_name}/{base_name}.{script_extention}' path_to_file = os.path.join(content_file.path_to_file, base_name) # read the py and yml files content - with open(yml_file_path, 'r') as f: + with open(yml_file_path) as f: yml_txt = f.read() - with open(script_file_path, 'r') as f: + with open(script_file_path) as f: script_txt = f.read() # create the yml file @@ -218,7 +273,7 @@ def split_yml_file(content_file: ContentFile): # pragma: no cover # create the description file description_file_path = f'{base_name}/{base_name}_description.md' if exists(description_file_path): - with open(description_file_path, 'r') as f: + with open(description_file_path) as f: description_txt = f.read() description_file = ContentFile() @@ -236,8 +291,12 @@ def commit_git(git_integration: str, branch_name: str, content_file: ContentFile commit_content_item_gitlab(branch_name, content_file, new_files, modified_files) elif git_integration == 'GitHub': commit_content_item(branch_name, content_file, new_files, modified_files) - else: # git_integration == 'Bitbucket' + elif git_integration == 'Bitbucket': commit_content_item_bitbucket(branch_name, content_file, new_files, modified_files) + elif git_integration == 'AzureDevOps': + commit_content_item_azure_devops(branch_name, content_file, new_files, modified_files) + else: + raise DemistoException(f"Unexpected {git_integration=}. Possible values: Gitlab, GitHub, Bitbucket and AzureDevOps.") ''' MAIN FUNCTION ''' @@ -281,7 +340,6 @@ def main(): else: commit_git(git_integration, branch_name, content_file, new_files, modified_files) - incident_url = demisto.demistoUrls().get('investigation') # create the PR text diff --git a/Packs/ContentManagement/Scripts/CommitFiles/CommitFiles.yml b/Packs/ContentManagement/Scripts/CommitFiles/CommitFiles.yml index b54fc054b231..2d49a163564a 100644 --- a/Packs/ContentManagement/Scripts/CommitFiles/CommitFiles.yml +++ b/Packs/ContentManagement/Scripts/CommitFiles/CommitFiles.yml @@ -13,6 +13,7 @@ args: - Gitlab - GitHub - Bitbucket + - AzureDevOps - description: The name of the pack. name: pack required: true @@ -30,7 +31,7 @@ commonfields: contentitemexportablefields: contentitemfields: fromServerVersion: '' -dockerimage: demisto/xsoar-tools:1.0.0.40869 +dockerimage: demisto/xsoar-tools:1.0.0.69232 enabled: true name: CommitFiles outputs: diff --git a/Packs/ContentManagement/Scripts/CommitFiles/CommitFiles_test.py b/Packs/ContentManagement/Scripts/CommitFiles/CommitFiles_test.py index acea263c03de..d7dbfb19b9dd 100644 --- a/Packs/ContentManagement/Scripts/CommitFiles/CommitFiles_test.py +++ b/Packs/ContentManagement/Scripts/CommitFiles/CommitFiles_test.py @@ -1,6 +1,10 @@ import os +from pathlib import Path + import demistomock as demisto from CommitFiles import ContentFile +import pytest +from CommonServerPython import * content_file = ContentFile() content_file.file_name = 'hello.py' @@ -23,6 +27,82 @@ def test_does_file_exist(mocker): assert not flag +@pytest.mark.parametrize('does_exist', [True, False]) +def test_does_file_exist_azure_devops(mocker, does_exist): + """ + Given: + - A branch name and a content file. + When: + - In order to know if this file already exists in the repository or not + Then: + - Returns True if the file exists and false if it doesn't + """ + if does_exist: + mocker.patch("CommitFiles.files_path", [str(Path(content_file.path_to_file, content_file.file_name))]) + from CommitFiles import searched_file_path + mocker.patch.object(demisto, 'executeCommand', return_value=[{"Type": 1, "Contents": {}}]) + flag = searched_file_path('demisto', content_file) + assert does_exist == flag + + +def test_commit_content_item_azure_devops_cant_find_branch(mocker): + """ + Given: + - A branch name and a content file. + When: + - Committing the files to azure devops + Then: + - Ensure Exception is thrown since branch doesn't exist + """ + from CommitFiles import commit_content_item_azure_devops + branch_name = 'demisto' + mocker.patch.object(demisto, 'executeCommand', return_value=[{"Type": 1, "Contents": {}}]) + with pytest.raises(DemistoException) as e: + commit_content_item_azure_devops(branch_name, content_file, [], []) + assert e.value.message == "Failed to find a corresponding branch id to the given branch name." + + +def test_commit_content_item_azure_devops_creating_file(mocker): + """ + Given: + - A branch name and a content file + When: + - Committing the files to azure devops + Then: + - Ensure the last executeCommand (azure-devops-file-create) called with the expected arguments + """ + from CommitFiles import commit_content_item_azure_devops + branch_name = 'demisto' + request = mocker.patch.object(demisto, 'executeCommand', return_value=[{"Type": 1, "Contents": + {"value": [{"name": "demisto", "objectId": "XXXX", "path": "Test"}]}}]) + commit_content_item_azure_devops(branch_name, content_file, [], []) + request.assert_called_with('azure-devops-file-create', args={'commit_comment': 'hello.py was added.', + 'file_path': 'Packs/Hi/Integrations/Folder/hello.py', + 'branch_name': 'demisto', 'file_content': 'hello world!', + 'branch_id': 'XXXX'}) + + +def test_commit_content_item_azure_devops_updating_file(mocker): + """ + Given: + - A branch name and a content file + When: + - Committing the files to azure devops + Then: + - Ensure the last executeCommand (azure-devops-file-update) called with the expected arguments + """ + mocker.patch("CommitFiles.files_path", [str(Path(content_file.path_to_file, content_file.file_name))]) + from CommitFiles import commit_content_item_azure_devops + branch_name = 'demisto' + request = mocker.patch.object(demisto, 'executeCommand', return_value=[{"Type": 1, "Contents": + {"value": [{"name": "demisto", "objectId": "XXXX", "path": "Test"}]}}]) + commit_content_item_azure_devops(branch_name, content_file, [], []) + request.assert_called_with('azure-devops-file-update', args={'commit_comment': 'hello.py was updated.', + 'file_path': 'Packs/Hi/Integrations/Folder/hello.py', + 'branch_name': 'demisto', 'file_content': 'hello world!', + 'branch_id': 'XXXX'}) + + def test_commit_content_item_bitbucket(mocker): """ Given: diff --git a/Packs/ContentManagement/Scripts/CustomPackInstaller/CustomPackInstaller.py b/Packs/ContentManagement/Scripts/CustomPackInstaller/CustomPackInstaller.py index 25d7341bf86d..fb2ab7703147 100644 --- a/Packs/ContentManagement/Scripts/CustomPackInstaller/CustomPackInstaller.py +++ b/Packs/ContentManagement/Scripts/CustomPackInstaller/CustomPackInstaller.py @@ -1,12 +1,11 @@ import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 -from typing import Tuple SCRIPT_NAME = 'CustomPackInstaller' -def install_custom_pack(pack_id: str, skip_verify: bool, skip_validation: bool, instance_name: str = '') -> Tuple[bool, str]: +def install_custom_pack(pack_id: str, skip_verify: bool, skip_validation: bool, instance_name: str = '') -> tuple[bool, str]: """Installs a custom pack in the machine. Args: @@ -43,7 +42,7 @@ def install_custom_pack(pack_id: str, skip_verify: bool, skip_validation: bool, args['using'] = instance_name status, res = execute_command( - 'demisto-api-install-packs', + 'core-api-install-packs', args, fail_on_error=False, ) diff --git a/Packs/ContentManagement/Scripts/CustomPackInstaller/CustomPackInstaller.yml b/Packs/ContentManagement/Scripts/CustomPackInstaller/CustomPackInstaller.yml index 970e6737e9e9..50591fb99660 100644 --- a/Packs/ContentManagement/Scripts/CustomPackInstaller/CustomPackInstaller.yml +++ b/Packs/ContentManagement/Scripts/CustomPackInstaller/CustomPackInstaller.yml @@ -33,7 +33,7 @@ tags: - Content Management timeout: '0' type: python -dockerimage: demisto/xsoar-tools:1.0.0.40869 +dockerimage: demisto/xsoar-tools:1.0.0.69232 tests: - No tests (auto formatted) fromversion: 6.0.0 diff --git a/Packs/ContentManagement/Scripts/SuggestBranchName/SuggestBranchName.py b/Packs/ContentManagement/Scripts/SuggestBranchName/SuggestBranchName.py index 07c69ef83621..051d22074010 100644 --- a/Packs/ContentManagement/Scripts/SuggestBranchName/SuggestBranchName.py +++ b/Packs/ContentManagement/Scripts/SuggestBranchName/SuggestBranchName.py @@ -1,16 +1,30 @@ import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 -ATTEMPS = 10 +ATTEMPTS = 10 + + +def find_available_branch_azure_devops(pack_name: str): + response = demisto.executeCommand('azure-devops-branch-list', args={}) + existing_branches = response[0].get("Contents", {}).get("value", []) + for i in range(1, ATTEMPTS + 1): + branch_name = f'{pack_name}_{i}' + branch_exists = any( + branch.get("name", "").endswith(branch_name) + for branch in existing_branches + ) + if not branch_exists: + return f'refs/heads/{branch_name}' + raise DemistoException('Please enter a branch name.') def find_available_branch(pack_name: str, command_get_branch: str): branch_name = pack_name - for i in range(ATTEMPS): + for i in range(ATTEMPTS): if i > 0: branch_name = f'{pack_name}_{i}' status, get_branch_res = execute_command(command_get_branch, {'branch_name': branch_name}, fail_on_error=False) - if (not status) and ('Bad Request' or 'Branch not found' or 'Not Found' in get_branch_res): + if (not status) and (True): return branch_name raise DemistoException('Please enter a branch name.') @@ -23,7 +37,11 @@ def main(): # pragma: no cover try: pack_name = demisto.getArg('pack') command_get_branch = demisto.getArg('use_command') - branch_name = find_available_branch(pack_name, command_get_branch) + + if command_get_branch == 'azure-devops-branch-list': + branch_name = find_available_branch_azure_devops(pack_name) + else: + branch_name = find_available_branch(pack_name, command_get_branch) return_results(CommandResults( readable_output=branch_name, diff --git a/Packs/ContentManagement/Scripts/SuggestBranchName/SuggestBranchName.yml b/Packs/ContentManagement/Scripts/SuggestBranchName/SuggestBranchName.yml index 566ab003edb4..3b96a40a9519 100644 --- a/Packs/ContentManagement/Scripts/SuggestBranchName/SuggestBranchName.yml +++ b/Packs/ContentManagement/Scripts/SuggestBranchName/SuggestBranchName.yml @@ -19,7 +19,7 @@ commonfields: contentitemexportablefields: contentitemfields: fromServerVersion: '' -dockerimage: demisto/python3:3.10.12.63474 +dockerimage: demisto/python3:3.10.12.68714 enabled: true name: SuggestBranchName outputs: diff --git a/Packs/ContentManagement/Scripts/SuggestBranchName/SuggestBranchName_test.py b/Packs/ContentManagement/Scripts/SuggestBranchName/SuggestBranchName_test.py index 1b0bc5d7f1cc..c9f51f1dc081 100644 --- a/Packs/ContentManagement/Scripts/SuggestBranchName/SuggestBranchName_test.py +++ b/Packs/ContentManagement/Scripts/SuggestBranchName/SuggestBranchName_test.py @@ -1,3 +1,4 @@ + import pytest import demistomock as demisto @@ -27,3 +28,22 @@ def test_find_available_branch(pack_name, command_get_branch, mocker): mocker.patch.object(demisto, 'executeCommand', return_value=mocker_bitbucket) branch_name = find_available_branch(pack_name, command_get_branch) assert branch_name == expected_branch_name + + +RESPONSE = [{"Contents": {"value": [{"name": "Test/Test"}, {"name": "Test/Test_1"}]}}] + + +@pytest.mark.parametrize('pack_name, response, expected_available_branch_name', [("Test", RESPONSE, "refs/heads/Test_2")]) +def test_find_available_branch_azure_devops(mocker, pack_name: str, response: list[dict], expected_available_branch_name: str): + """ + Given: + - A pack name + When: + - Two branches exist + Then: + - Returning an available name for the new branch + """ + from SuggestBranchName import find_available_branch_azure_devops + mocker.patch.object(demisto, 'executeCommand', return_value=response) + branch_name = find_available_branch_azure_devops(pack_name) + assert branch_name == expected_available_branch_name diff --git a/Packs/ContentManagement/pack_metadata.json b/Packs/ContentManagement/pack_metadata.json index 57a5ad3760ec..f89e63fd6b7f 100644 --- a/Packs/ContentManagement/pack_metadata.json +++ b/Packs/ContentManagement/pack_metadata.json @@ -2,7 +2,7 @@ "name": "XSOAR CI/CD", "description": "This pack enables you to orchestrate your XSOAR system configuration.", "support": "xsoar", - "currentVersion": "1.2.11", + "currentVersion": "1.2.12", "author": "Cortex XSOAR", "url": "https://www.paloaltonetworks.com/cortex", "email": "",