### Get All Jira Issue Types Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraIssueType.md This example returns all the IssueTypes on the JIRA server. Ensure you have a JIRA session or provide credentials. ```powershell Get-JiraIssueType ``` -------------------------------- ### Add-JiraIssueAttachment Examples Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Add-JiraIssueAttachment.md Examples showing direct attachment and pipeline usage. ```powershell Add-JiraIssueAttachment -FilePath "Test comment" -Issue "TEST-001" ``` ```powershell Get-JiraIssue "TEST-002" | Add-JiraIssueAttachment -FilePath "Test comment from PowerShell" ``` -------------------------------- ### Install Pester Module Source: https://github.com/atlassianps/jiraps/blob/master/Tests/README.md Ensure you have Pester version 5.7 or later installed. Use `Install-Module` with `-MinimumVersion` and `-Force` to install or update Pester. ```powershell Install-Module Pester -MinimumVersion 5.7 -Force ``` -------------------------------- ### Install PSJira Module Source: https://github.com/atlassianps/jiraps/wiki/Getting-Started Installs the PSJira module from the PowerShell Gallery. Ensure you have the PowerShellGet module installed. Elevated privileges may be required for installation or configuration if the module is installed to a protected directory. ```powershell Install-Module PSJira ``` -------------------------------- ### Move-JiraVersion Usage Examples Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Move-JiraVersion.md Demonstrates moving versions using IDs, objects, and positional keywords. ```powershell Move-JiraVersion -Version 10 -After 9 ``` ```powershell Move-JiraVersion -Version $myVersionObject -After $otherVersionObject ``` ```powershell Move-JiraVersion -Version $myVersionObject -Position Earliest ``` -------------------------------- ### Retrieve JIRA Priorities Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraPriority.md Examples demonstrating how to fetch all priorities or a specific priority by its ID. ```powershell Get-JiraPriority ``` ```powershell Get-JiraPriority -ID 1 ``` -------------------------------- ### Get All Jira Projects with Credentials (GET Request) Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Invoke-JiraMethod.md Prompts the user for Jira credentials and sends a GET request to retrieve all projects on the Jira server. ```powershell Invoke-JiraMethod -URI "$(Get-JiraConfigServer)/rest/api/latest/project" -Credential (Get-Credential) ``` -------------------------------- ### Get-JiraVersion Usage Examples Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraVersion.md Common usage patterns for retrieving JIRA version information. ```powershell Get-JiraVersion -Project $ProjectKey ``` ```powershell Get-JiraVersion -Project $ProjectKey -Name '1.0.0.0' ``` ```powershell Get-JiraProject "FOO", "BAR" | Get-JiraVersion -Name "v1.0", "v2.0" ``` ```powershell Get-JiraVersion -ID '66596' ``` -------------------------------- ### Get Group Members Using Pipeline Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraGroupMember.md This example demonstrates piping the output of Get-JiraGroup to Get-JiraGroupMember to retrieve members of the 'Developers' group. Ensure Get-JiraGroup is available and configured. ```powershell Get-JiraGroup 'Developers' | Get-JiraGroupMember ``` -------------------------------- ### Initialize Test Environment and Mocking Pattern Source: https://github.com/atlassianps/jiraps/blob/master/Tests/README.md Standard setup for test discovery and module scoping using TestTools.ps1 helpers. ```powershell BeforeDiscovery { . "$PSScriptRoot/../../Helpers/TestTools.ps1" Initialize-TestEnvironment # Clean up modules $script:moduleToTest = Resolve-ModuleSource # Get module path Import-Module $script:moduleToTest -Force -ErrorAction Stop } InModuleScope JiraPS { Describe "YourFunction" -Tag 'Unit' { BeforeAll { . "$PSScriptRoot/../../Helpers/TestTools.ps1" # $VerbosePreference = 'Continue' # Uncomment to debug mocks Mock Get-JiraFilter -ModuleName JiraPS { Write-MockDebugInfo 'Get-JiraFilter' 'Id' # Shows: Id = 123 # mock logic } } } } ``` -------------------------------- ### Retrieve issue watchers Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraIssueWatcher.md Examples demonstrating how to fetch watchers for a JIRA issue using direct parameters or the pipeline. ```powershell Get-JiraIssueWatcher -Key TEST-001 ``` ```powershell Get-JiraIssue TEST-002 | Get-JiraIssueWatcher ``` -------------------------------- ### Get All Jira Projects (GET Request) Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Invoke-JiraMethod.md Sends a GET request to retrieve all projects on the Jira server. This can be executed anonymously or require an existing session. ```powershell Invoke-JiraMethod -URI "$(Get-JiraConfigServer)/rest/api/latest/project" ``` -------------------------------- ### Save GET Request Response to File Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Invoke-JiraMethod.md Executes a GET request for all available projects and saves the JSON response to the specified file. ```powershell $parameter = @{ URI = "$(Get-JiraConfigServer)/rest/api/latest/project" Method = "GET" OutFile = "c:\temp\jira_projects.json" Credential = $cred } Invoke-JiraMethod @parameter ``` -------------------------------- ### Get-JiraFilter Usage Examples Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraFilter.md Common usage patterns for retrieving JIRA filter information. ```powershell Get-JiraFilter -Id 12345 ``` ```powershell $filterObject | Get-JiraFilter ``` ```powershell Get-JiraFilter -Favorite ``` -------------------------------- ### Remove-JiraSession Usage Examples Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Remove-JiraSession.md Examples demonstrating how to close a JIRA session using either the default session or a specific session variable. ```powershell New-JiraSession -Credential (Get-Credential jiraUsername) Get-JiraIssue TEST-01 Remove-JiraSession ``` ```powershell $s = New-JiraSession -Credential (Get-Credential jiraUsername) Remove-JiraSession $s ``` -------------------------------- ### Create Jira Issue with Custom Fields Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/about_JiraPS_CustomFields.md Demonstrates a comprehensive example of defining project, issue type, and various custom field inputs for a new issue. ```powershell $fields = @{ project = "TV" issuetype = "bug" summary = "Important Issue" description = "This Issue is *very* important\n\n really!?" Assignee = "admin" Reporter = "admin" Priority = 1 Fields = @{ labels = @("important", "notreally") fixVersion = @( @{ name = "Release 1.1"} ) customfield_10001 = @{ name = "item from a dropdown" } duedate = "2020-01-01" } } ``` -------------------------------- ### Retrieve JIRA issue attachments Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraIssueAttachment.md Examples demonstrating how to fetch attachments from a specific JIRA issue using direct parameters or the pipeline. ```powershell Get-JiraIssueAttachment -Issue TEST-001 ``` ```powershell Get-JiraIssue TEST-002 | Get-JiraIssueAttachment ``` ```powershell Get-JiraIssue TEST-002 | Get-JiraIssueAttachment -FileName "*.png" ``` -------------------------------- ### Create a new JIRA Version with Release Date Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/New-JiraVersion.md This example demonstrates creating a new JIRA version with a specific release date. First, retrieve the project object using Get-JiraProject, then use New-JiraVersion with the project object and the desired release date. ```powershell $project = Get-JiraProject -Project "RD" New-JiraVersion -Name '1.0.0.0' -Project $project -ReleaseDate "2000-12-31" ``` -------------------------------- ### Install and Update JiraPS Source: https://github.com/atlassianps/jiraps/blob/master/README.md Install the module for the current user and check for updates periodically. ```powershell # One time only install: Install-Module JiraPS -Scope CurrentUser # Check for updates occasionally: Update-Module JiraPS ``` -------------------------------- ### GET Request with Custom Headers and Output File Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Invoke-JiraMethod.md Executes a GET request on the defined URI, specifying expected response MIME types via Headers, and saves the output to a file. ```powershell $parameter = @{ URI = "$(Get-JiraConfigServer)/rest/api/latest/project" Method = "GET" Headers = @{"Accept" = "text/plain"} OutFile = "c:\temp\jira_projects.json" Credential = $cred } Invoke-JiraMethod @parameter ``` -------------------------------- ### Add User to a JIRA Group Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Add-JiraGroupMember.md This is a basic example of adding a user to a specific group. Ensure the group and user exist in JIRA. ```powershell Add-JiraGroupMember -Group testUsers -User jsmith ``` -------------------------------- ### Create Jira Issue using Splatting Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/New-JiraIssue.md This example shows how to use splatting to pass parameters to the New-JiraIssue cmdlet, improving readability for complex commands. Define parameters in a hashtable and pass it using the @ symbol. ```powershell $parameters = @{ Project = "TEST" IssueType = "Bug" Priority = 1 Summary = 'Test issue from PowerShell' Description = 'This is a test issue created from the JiraPS module in PowerShell.' Fields = @{ "Custom Field Name 1" = @{"foo" = "bar"} customfield_10001 = @('baz') } } New-JiraIssue @parameters ``` -------------------------------- ### Configure Jira Server and Get Issue Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/about_JiraPS.md Configure the Jira server address and retrieve issue details using provided credentials. Ensure the server address is set before making API calls. ```powershell # Tell the module what is the server's address Set-JiraConfigServer -Server "https://jira.server.com" # Get the user credentials with which to authenticate $cred = Get-Credential # Get the date from the issue "PR-123" Get-JiraIssue -Issue "PR-123" -Credential $cred ``` -------------------------------- ### Send POST Request with Parameters Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Invoke-JiraMethod.md Sends a POST request to the server using a hashtable of parameters. Note that this example may not perform a meaningful action without a BODY value for the content API. ```powershell $parameter = @{ URI = "$(Get-JiraConfigServer)/rest/api/latest/project" Method = "POST" Credential = $cred } Invoke-JiraMethod @parameter ``` -------------------------------- ### Remove a JIRA version Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Remove-JiraVersion.md Examples showing how to remove a version using either a pipeline object or a direct ID. ```powershell Get-JiraVersion -Name '1.0.0.0' -Project $Project | Remove-JiraVersion ``` ```powershell Remove-JiraVersion -Version '66596' ``` -------------------------------- ### Add a Simple Comment to a JIRA Issue Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Add-JiraIssueComment.md This example demonstrates how to add a basic comment to a specific JIRA issue using its key. ```powershell Add-JiraIssueComment -Comment "Test comment" -Issue "TEST-001" ``` -------------------------------- ### Duplicate a JIRA Version to another Project Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/New-JiraVersion.md This example shows how to duplicate an existing JIRA version to a different project. It involves retrieving the original version, updating its project key, and then piping it to New-JiraVersion. ```powershell $version = Get-JiraVersion -Name "1.0.0.0" -Project "RD" $version = $version.Project.Key "TEST" $version | New-JiraVersion ``` -------------------------------- ### GET Get-JiraComponent Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraComponent.md Retrieves component information from Jira based on component ID or project key. ```APIDOC ## GET Get-JiraComponent ### Description Returns information regarding a specified component from Jira. Components are specific to a Project, so queries must be scoped by project or specific component ID. ### Method GET ### Parameters #### Path Parameters - **ComponentId** (Int32[]) - Required (ByID set) - The ID of the component. - **Project** (Object[]) - Required (ByProject set) - The ID or Key of the Project to search. #### Request Body - **Credential** (PSCredential) - Optional - Credentials to use to connect to JIRA. If not specified, anonymous access is used. ### Request Example Get-JiraComponent -Id 10000 ### Response #### Success Response (200) - **JiraPS.Component** (Object) - Returns the component object details. ``` -------------------------------- ### GET Get-JiraProject Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraProject.md Retrieves project information from Jira. If no project is specified, it returns all projects the user is authorized to view. ```APIDOC ## GET Get-JiraProject ### Description Returns information regarding a specified project from Jira. If the Project parameter is not supplied, it returns information about all projects the user is authorized to view. ### Method GET ### Parameters #### Query Parameters - **Project** (String[]) - Optional - The Project ID or project key of a project to search. - **Credential** (PSCredential) - Optional - Credentials to use to connect to JIRA. ### Request Example Get-JiraProject -Project TEST ### Response #### Success Response (200) - **Output** (JiraPS.Project) - Returns an object containing project details. ``` -------------------------------- ### Get Jira Issue Link Types with Credentials Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraIssueLinkType.md This syntax demonstrates how to use the Get-JiraIssueLinkType cmdlet with explicit credentials. Ensure you have valid credentials for the JIRA server. ```powershell Get-JiraIssueLinkType -Credential ``` -------------------------------- ### Create Jira Issue with Multiple Field Types Source: https://context7.com/atlassianps/jiraps/llms.txt A comprehensive example demonstrating the creation of a Jira issue with various field types, including text, priority, labels, components, dates, and custom fields. ```powershell New-JiraIssue -Project TEST -IssueType Bug -Summary "Complex issue" -Fields @{ description = "Detailed bug description" priority = @{ id = "2" } labels = @("urgent", "production") components = @(@{ name = "API" }) duedate = "2024-06-30" customfield_10001 = @{ value = "Production" } customfield_10002 = 100 } ``` -------------------------------- ### Format Specific Properties to JIRA Markdown Table Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Format-Jira.md This example demonstrates how to select specific properties (Name, Id, VM) from PowerShell objects before formatting them into a JIRA markdown table. This is useful for reducing the amount of data included in the table. ```powershell Get-Process chrome | Format-Jira Name,Id,VM ``` -------------------------------- ### Add User to a JIRA Group via Pipeline Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Add-JiraGroupMember.md This example demonstrates using the pipeline to pipe a group object to Add-JiraGroupMember. This is useful when you've just retrieved group information. ```powershell Get-JiraGroup 'Project Admins' | Add-JiraGroupMember -User jsmith ``` -------------------------------- ### Get Members of a Specific JIRA Group Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraGroupMember.md Use this command to retrieve all members of a JIRA group by its name. No special setup is required. ```powershell Get-JiraGroupMember testGroup ``` -------------------------------- ### Update User Properties Using Hashtable with Set-JiraUser Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Set-JiraUser.md This example demonstrates updating multiple user properties, including email and display name, by providing a hashtable. This method is useful for properties not directly available as parameters. ```powershell Set-JiraUser -User user2 -Property @{emailAddress='user2_new@example.com';displayName='User 2'} ``` -------------------------------- ### Get Jira Group Members Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraGroup.md Retrieves the members of a specified Jira group. This example pipes the output of Get-JiraGroup to Get-JiraGroupMember. Requires a valid Jira session or credentials. ```powershell Get-JiraGroup -GroupName testGroup | Get-JiraGroupMember ``` -------------------------------- ### Comment on Multiple Issues Matching a JQL Query Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Add-JiraIssueComment.md This example illustrates adding a comment to all issues that satisfy a given JQL query. It is recommended to validate the JQL query first to ensure it returns the intended issues. ```powershell Get-JiraIssue -Query 'project = "TEST" AND created >= -5d' | Add-JiraIssueComment "This issue has been cancelled per Vice President's orders." ``` -------------------------------- ### Create Jira Issue with Custom Fields Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/New-JiraIssue.md This example demonstrates creating an issue using both standard parameters and custom fields. It first identifies required fields using Get-JiraIssueCreateMetadata, then creates the issue, specifying custom fields by name and ID. ```powershell Get-JiraIssueCreateMetadata -Project TEST -IssueType Bug | ? {$_.Required -eq $true} New-JiraIssue -Project TEST -IssueType Bug -Priority 1 -Summary 'Test issue from PowerShell' -Description 'This is a test issue created from the JiraPS module in PowerShell.' -Fields @{'Custom Field Name 1'=@{"foo" = "bar"};'customfield_10001'=@('baz');} ``` -------------------------------- ### Get Specific Jira Issue Type by Name Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraIssueType.md This example returns only the IssueType named "Bug". Use the -IssueType parameter to specify the desired issue type. ```powershell Get-JiraIssueType -IssueType "Bug" ``` -------------------------------- ### Remove Favorite Status from Filters Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Set-JiraFilter.md This example demonstrates how to remove the favorite status from multiple Jira filters that meet specific criteria (name not starting with 'My'). It pipes the output of Get-JiraFilter to Where-Object and then to Set-JiraFilter. ```powershell Get-JiraFilter -Favorite | Where name -notlike "My*" | Set-JiraFilter -Favorite $false ``` -------------------------------- ### Get Jira Issue Types by Name or ID Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraIssueType.md This example returns information about IssueTypes by their names ("Bug", "Task") and by their ID ("4"). The -IssueType parameter accepts an array of strings for multiple lookups. ```powershell Get-JiraIssueType -IssueType "Bug","Task","4" ``` -------------------------------- ### Create Jira Session Source: https://github.com/atlassianps/jiraps/wiki/Getting-Started Establishes a new session with your Jira credentials. This command needs to be run each time a new PowerShell session is started, or it can be added to your PowerShell profile. Refer to the [[Security]] page for more information. ```powershell New-JiraSession -Credential (Get-Credential) ``` -------------------------------- ### Initialize JiraPS Session Source: https://github.com/atlassianps/jiraps/blob/master/README.md Import the module, configure the server URL, and establish a session using credentials. ```powershell # To use each session: Import-Module JiraPS Set-JiraConfigServer 'https://YourCloud.atlassian.net' New-JiraSession -Credential $cred ``` -------------------------------- ### Retrieve project by key Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraProject.md Fetches details for a specific project using its key and provided credentials. ```powershell Get-JiraProject -Project TEST -Credential $cred ``` -------------------------------- ### Create a new JIRA Version by Name and Project Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/New-JiraVersion.md Use this command to create a new JIRA version with a specified name in a given project. Ensure the project key is correct. ```powershell New-JiraVersion -Name '1.0.0.0' -Project "RD" ``` -------------------------------- ### Retrieve Components by Project Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraComponent.md Fetches components associated with one or more projects. ```powershell Get-JiraProject "Project1" | Get-JiraComponent ``` ```powershell Get-JiraComponent ABC,DEF ``` -------------------------------- ### Remove Jira User Example Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Remove-JiraUser.md Example of how to remove a Jira user by their username. Ensure you have the necessary permissions and consider the implications of user deletion. ```powershell Remove-JiraUser -UserName testUser ``` -------------------------------- ### Invoke Jira REST API GET Request Source: https://context7.com/atlassianps/jiraps/llms.txt Performs a GET request to a specified Jira REST API endpoint. Useful for retrieving data not covered by specific cmdlets. Requires the URI and optionally accepts credentials. ```powershell Invoke-JiraMethod -URI "$(Get-JiraConfigServer)/rest/api/latest/project" ``` ```powershell Invoke-JiraMethod -URI "$(Get-JiraConfigServer)/rest/api/latest/myself" -Credential $cred ``` -------------------------------- ### New-JiraVersion Syntax by Parameters Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/New-JiraVersion.md This syntax for New-JiraVersion allows creating a version by specifying its properties directly, such as name, project, description, and release details. It is used when not providing an input object. ```powershell New-JiraVersion [-Name] [-Project] [-Description ] [-Archived ] [-Released ] [-ReleaseDate ] [-StartDate ] [-Credential ] [-WhatIf] [-Confirm] [] ``` -------------------------------- ### GET Get-JiraIssueAttachmentFile Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraIssueAttachmentFile.md Downloads a specified Jira issue attachment to the local disk. ```APIDOC ## GET Get-JiraIssueAttachmentFile ### Description This function downloads an attachment of an issue to the local disk. ### Parameters #### Path Parameters - **Attachment** (JiraPS.Attachment) - Required - The attachment object to be downloaded. - **Path** (String) - Optional - The local directory path where the file will be saved. - **Credential** (PSCredential) - Optional - Credentials to use for JIRA authentication. ``` -------------------------------- ### GET Get-JiraConfigServer Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraConfigServer.md Retrieves the configured JIRA server URL from the JiraPS configuration. ```APIDOC ## GET Get-JiraConfigServer ### Description Obtains the configured URL for the JIRA server that JiraPS should manipulate. ### Method GET ### Endpoint Get-JiraConfigServer ### Parameters #### Path Parameters - **ConfigFile** (String) - Optional - The path to the configuration file to read from. ### Request Example Get-JiraConfigServer ### Response #### Success Response (200) - **URL** (String) - The configured JIRA server URL. #### Response Example "https://jira.example.com" ``` -------------------------------- ### Create a New Issue Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/about_JiraPS_CreatingIssues.md Demonstrates creating a Jira issue using direct parameters or a splatted hash table for better readability. ```powershell New-JiraIssue -Project TEST -IssueType Task -Reporter 'powershell' -Summary 'Test issue from PowerShell' -Credential $myJiraCreds ``` ```powershell $parameters = @{ Project = TEST IssueType = Task Reporter = 'powershell' Summary = 'Test issue from PowerShell' Description = "This is a sample issue created by $env:USERNAME on $env:COMPUTERNAME." Labels = 'Test','Fake' Credential = $myJiraCreds } New-JiraIssue @parameters ``` -------------------------------- ### GET Get-JiraIssueType Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraIssueType.md Retrieves all available issue types or specific ones from the JIRA server. ```APIDOC ## GET Get-JiraIssueType ### Description Retrieves all available IssueTypes on the JIRA server and returns them as JiraPS.IssueType objects. Can be filtered by specific IssueType names or IDs. ### Method GET ### Parameters #### Path Parameters - **IssueType** (String[]) - Optional - The Issue Type name or ID to search. #### Request Body - **Credential** (PSCredential) - Optional - Credentials to use to connect to JIRA. If not specified, uses anonymous access. ### Response #### Success Response (200) - **Output** (JiraPS.IssueType) - Returns information about the available issue types. ``` -------------------------------- ### Access JiraPS Help and Commands Source: https://github.com/atlassianps/jiraps/blob/master/README.md Use standard PowerShell help commands to explore module functionality and documentation. ```powershell # Review the help at any time! Get-Help about_JiraPS Get-Command -Module JiraPS Get-Help Get-JiraIssue -Full # or any other command ``` -------------------------------- ### Parameter Definitions Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraIssueAttachment.md Configuration details for the cmdlet parameters. ```yaml Type: Object Parameter Sets: (All) Aliases: Key Required: True Position: 1 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False ``` ```yaml Type: String Parameter Sets: (All) Aliases: Required: False Position: 2 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ```yaml Type: PSCredential Parameter Sets: (All) Aliases: Required: False Position: 3 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -------------------------------- ### Parameter Configuration Blocks Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Add-JiraIssueAttachment.md Configuration details for cmdlet parameters. ```yaml Type: Object Parameter Sets: (All) Aliases: Key Required: True Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ```yaml Type: String[] Parameter Sets: (All) Aliases: InFile, FullName, Path Required: True Position: 2 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False ``` ```yaml Type: PSCredential Parameter Sets: (All) Aliases: Required: False Position: 3 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ```yaml Type: SwitchParameter Parameter Sets: (All) Aliases: Required: False Position: Named Default value: False Accept pipeline input: False Accept wildcard characters: False ``` ```yaml Type: SwitchParameter Parameter Sets: (All) Aliases: wi Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ```yaml Type: SwitchParameter Parameter Sets: (All) Aliases: cf Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -------------------------------- ### GET /Get-JiraIssue Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraIssue.md Retrieves information about one or more issues from JIRA based on various search criteria. ```APIDOC ## GET Get-JiraIssue ### Description Retrieves the data of an issue or set of issues in JIRA. Supports querying by specific issue key, existing issue object, JQL query, or saved filter. ### Parameters #### Query Parameters - **Key** (String[]) - Required (ByIssueKey) - Key of the issue to search for. - **InputObject** (Object[]) - Required (ByInputObject) - Object of an issue to search for. - **Query** (String) - Required (ByJQL) - JQL query for which to search for. - **Filter** (Object) - Required (ByFilter) - Object of an existing JIRA filter from which the results will be returned. - **Fields** (String[]) - Optional - List of specific fields to retrieve to reduce payload size. - **IncludeTotalCount** (Switch) - Optional - Whether to include the total count of issues. - **Skip** (UInt64) - Optional - Number of issues to skip. - **First** (UInt64) - Optional - Number of issues to return. - **StartIndex** (UInt32) - Optional - Starting index for JQL/Filter queries. - **MaxResults** (UInt32) - Optional - Maximum number of results for JQL/Filter queries. - **PageSize** (UInt32) - Optional - Page size for JQL/Filter queries. ### Request Example Get-JiraIssue -Query 'project = "TEST"' -Fields "key", "summary" ``` -------------------------------- ### Parameter Configuration Blocks Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Move-JiraVersion.md YAML-formatted metadata for cmdlet parameters. ```yaml Type: Object Parameter Sets: (All) Aliases: Required: True Position: 1 Default value: None Accept pipeline input: True Accept wildcard characters: False ``` ```yaml Type: String Parameter Sets: ByPosition Aliases: Accepted values: First, Last, Earlier, Later Required: True Position: 2 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ```yaml Type: Object Parameter Sets: ByAfter Aliases: Required: True Position: 2 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ```yaml Type: PSCredential Parameter Sets: (All) Aliases: Required: False Position: 3 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -------------------------------- ### Parameter Configuration Blocks Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/New-JiraGroup.md YAML-formatted metadata for cmdlet parameters. ```yaml Type: String[] Parameter Sets: (All) Aliases: Name Required: True Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ```yaml Type: PSCredential Parameter Sets: (All) Aliases: Required: False Position: 2 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ```yaml Type: SwitchParameter Parameter Sets: (All) Aliases: wi Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` ```yaml Type: SwitchParameter Parameter Sets: (All) Aliases: cf Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -------------------------------- ### GET /serverInfo Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraServerInformation.md Retrieves information about the Jira server, including version and deployment type (Cloud or Server). ```APIDOC ## GET /serverInfo ### Description Retrieves server information. The result is cached for the duration of the PowerShell session. The returned object includes a `DeploymentType` property used by JiraPS to determine API compatibility. ### Method GET ### Parameters #### Query Parameters - **Credential** (PSCredential) - Optional - Credentials to use for authentication. If omitted, anonymous access is attempted. - **Force** (SwitchParameter) - Optional - If present, bypasses the local cache and forces a fresh request to the Jira server. ### Response #### Success Response (200) - **DeploymentType** (String) - Indicates if the instance is 'Cloud' or 'Server'. - **Version** (String) - The version of the Jira instance. ### Response Example { "DeploymentType": "Cloud", "Version": "1001.0.0-SNAPSHOT" } ``` -------------------------------- ### Get Issues in a Project Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/about_JiraPS.md Retrieve all issues within a specified Jira project using a JQL query. ```powershell Get-JiraIssue -Query "project = CS" ``` -------------------------------- ### GET Get-JiraUser Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraUser.md Retrieves user information from Jira based on provided search criteria such as username or account ID. ```APIDOC ## GET Get-JiraUser ### Description Returns information regarding a specified user from Jira. If no parameters are provided, it returns the user executing the command. ### Parameters #### Query Parameters - **UserName** (String[]) - Required (in ByUserName set) - Name of the user to search for. - **AccountId** (String[]) - Required (in ByAccountId set) - Atlassian account ID of the user. - **InputObject** (Object[]) - Required (in ByInputObject set) - User Object of the user. - **Exact** (Switch) - Optional - Limits the search to users where the username or account ID is exactly the term searched for. - **IncludeInactive** (SwitchParameter) - Optional - Include inactive users in the search. - **MaxResults** (UInt32) - Optional - Maximum number of users to be returned (max 1000). - **Skip** (UInt64) - Optional - Controls how many objects will be skipped before starting output. - **Credential** (PSCredential) - Optional - Credentials to use to connect to JIRA. ### Request Example Get-JiraUser -UserName "user1" -Exact ### Response #### Success Response (200) - **Output** (JiraPS.User) - Returns a JiraPS.User object containing user details. ``` -------------------------------- ### Set-JiraConfigServer Syntax Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Set-JiraConfigServer.md The standard syntax for the Set-JiraConfigServer command. ```powershell Set-JiraConfigServer [-Server] [] ``` -------------------------------- ### GET /Get-JiraIssueEditMetadata Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraIssueEditMetadata.md Retrieves the metadata required to update a specific Jira issue, useful for identifying fields for Set-JiraIssue. ```APIDOC ## GET Get-JiraIssueEditMetadata ### Description Returns metadata required to update an issue in JIRA, including fields that can be defined during the update process. ### Method GET ### Parameters #### Path Parameters - **Issue** (String) - Required - Issue id or key of the reference issue. #### Query Parameters - **Credential** (PSCredential) - Optional - Credentials to use to connect to JIRA. If not specified, anonymous access is used. ### Response #### Success Response (200) - **JiraPS.Field** (Object) - Returns the metadata fields available for the specified issue. ``` -------------------------------- ### Project and Version Management Source: https://context7.com/atlassianps/jiraps/llms.txt Commands for retrieving project details and managing project versions. ```APIDOC ## Get-JiraProject ### Description Retrieves project information from JIRA. ### Parameters - **Project** (string/int) - Optional - The project key or ID ## New-JiraVersion ### Description Creates a new version (release) in a JIRA project. ### Parameters - **Project** (string) - Required - The project key - **Name** (string) - Required - Version name - **Description** (string) - Optional - Version description - **ReleaseDate** (string) - Optional - Release date in YYYY-MM-DD format ``` -------------------------------- ### Create Jira Issues Source: https://context7.com/atlassianps/jiraps/llms.txt Demonstrates bulk creation of issues from a CSV file and creating a sub-task. ```powershell $csv = @" project,summary,IssueType,Priority,Description TEST,Issue 1,Bug,1,First issue description TEST,Issue 2,Task,2,Second issue description "@ $csv | Out-File "./issues.csv" Import-Csv "./issues.csv" | ForEach-Object { New-JiraIssue -Project $_.project -IssueType $_.IssueType -Summary $_.summary -Priority $_.Priority -Description $_.Description } ``` ```powershell New-JiraIssue -Project TEST -IssueType "Sub-task" -Summary "Implement unit tests" -Parent TEST-001 ``` -------------------------------- ### Manage Jira Projects Source: https://context7.com/atlassianps/jiraps/llms.txt Retrieve project details by key, ID, or list multiple projects. ```powershell # Get all projects the user can view Get-JiraProject # Get specific project by key Get-JiraProject -Project TEST # Get project by ID Get-JiraProject -Project 10001 # Get multiple projects Get-JiraProject -Project TEST, PROD, DEV # List all project keys Get-JiraProject | Select-Object Key, Name, Lead ``` -------------------------------- ### Get Jira Issues by Filter Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraIssue.md Retrieves all issues that match the criteria defined in a saved Jira filter, identified by its ID. ```powershell Get-JiraFilter -Id 12345 | Get-JiraIssue ``` -------------------------------- ### Parameter Configuration Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraRemoteLink.md Configuration details for the cmdlet parameters. ```yaml Type: Object Parameter Sets: (All) Aliases: Key Required: True Position: 1 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False ``` ```yaml Type: Int32 Parameter Sets: (All) Aliases: Required: False Position: 2 Default value: 0 Accept pipeline input: False Accept wildcard characters: False ``` ```yaml Type: PSCredential Parameter Sets: (All) Aliases: Required: False Position: 3 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -------------------------------- ### Modify Jira Version Name Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Set-JiraVersion.md Use this example to rename an existing JIRA version. It pipes the output of Get-JiraVersion to Set-JiraVersion. ```powershell Get-JiraVersion -Project $Project -Name "Old-Name" | Set-JiraVersion -Name 'New-Name' ``` -------------------------------- ### Search for multiple filter names Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Find-JiraFilter.md Demonstrates searching for multiple filter names using the pipeline or a list of names. ```powershell 'My','Your' | Find-JiraFilter ``` ```powershell Find-JiraFilter -Name 'My','Your' ``` -------------------------------- ### Parameter Configuration Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraPriority.md YAML-formatted parameter definitions for Id and Credential. ```yaml Type: Int32[] Parameter Sets: _Search Aliases: Required: True Position: 1 Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` ```yaml Type: PSCredential Parameter Sets: (All) Aliases: Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -------------------------------- ### Manage Jira Filter Permissions Source: https://context7.com/atlassianps/jiraps/llms.txt Manages permissions for a Jira filter. Supports adding, getting, and removing permissions for groups or users. ```powershell Add-JiraFilterPermission -Filter 12345 -Type Group -Value 'jira-developers' ``` ```powershell Get-JiraFilterPermission -Filter 12345 ``` ```powershell Remove-JiraFilterPermission -Filter 12345 -PermissionId 10001 ``` -------------------------------- ### Create a Basic Jira Issue Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/New-JiraIssue.md Use this command to create a new issue with only the mandatory fields. Ensure the Project, IssueType, and Summary are provided. ```powershell New-JiraIssue -Project "TEST" -Type "Bug" -Summary "Test issue" ``` -------------------------------- ### Store Jira Session Information Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Invoke-JiraMethod.md Executes a GET request and stores the session information, returning a [JiraPS.Session] object containing the [WebRequestSession]. ```powershell $params = @{ Uri = "$(Get-JiraConfigServer)/rest/api/latest/mypermissions" Method = "GET" Body = $body StoreSession = $true Credential = $cred } Invoke-JiraMethod @params ``` -------------------------------- ### Get All Fields of Jira Issues from Filter Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraIssue.md Retrieves all available fields for issues matching a specified filter, useful for detailed analysis. ```powershell Get-JiraFilter 12345 | Get-JiraIssue | Select-Object * ``` -------------------------------- ### Add-JiraIssueWatcher Syntax Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Add-JiraIssueWatcher.md The standard syntax for the Add-JiraIssueWatcher cmdlet. ```powershell Add-JiraIssueWatcher [-Watcher] [-Issue] [[-Credential] ] [-WhatIf] [-Confirm] [] ``` -------------------------------- ### Get Jira Issue by Input Object Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraIssue.md Updates the information for an issue using a previously obtained issue object stored in a variable. ```powershell Get-JiraIssue -InputObject $oldIssue ``` -------------------------------- ### Get Jira Group Information Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraGroup.md Retrieves information about a specific group in Jira. Ensure you have a valid Jira session or provide credentials. ```powershell Get-JiraGroup -GroupName testGroup ``` -------------------------------- ### Add a watcher using the pipeline Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Add-JiraIssueWatcher.md Demonstrates piping an issue object from Get-JiraIssue to the watcher command. ```powershell Get-JiraIssue "TEST-002" | Add-JiraIssueWatcher "fred" ``` -------------------------------- ### Get information about the current Jira session Source: https://github.com/atlassianps/jiraps/wiki/Security Retrieves details about the currently active PSJira session. This is useful for verifying session status. ```powershell Get-JiraSession ``` -------------------------------- ### Get Jira Issue by Key Source: https://github.com/atlassianps/jiraps/wiki/Getting-Started Retrieves a specific Jira issue using its unique key. This is a fundamental operation for accessing issue details. ```powershell Get-JiraIssue -Key JRA-001 ``` -------------------------------- ### View All Issue Information Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/about_JiraPS.md Display all available properties of a specific Jira issue using `Format-List`. This is useful when the default table view is minimized. ```powershell Get-JiraIssue "CS-15" | Format-List * ``` -------------------------------- ### Modify Jira Version Description Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Set-JiraVersion.md This example demonstrates how to update the description of a JIRA version using its ID. It pipes the output of Get-JiraVersion to Set-JiraVersion. ```powershell Get-JiraVersion -ID 162401 | Set-JiraVersion -Description 'Descriptive String' ``` -------------------------------- ### Add Labels to Jira Issues Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Set-JiraIssueLabel.md This example adds a label to issues retrieved by a JQL query. Ensure the JQL correctly identifies the target issues. ```powershell Get-JiraIssue -Query 'created >= -7d AND reporter in (joeSmith)' | Set-JiraIssueLabel -Add 'enhancement' ``` -------------------------------- ### Remove a JIRA Group Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Remove-JiraGroup.md Use this cmdlet to remove a specific group from JIRA. Ensure you have the necessary permissions. This example removes a group named 'testGroup'. ```powershell Remove-JiraGroup -GroupName testGroup ``` -------------------------------- ### Server Parameter Configuration Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Set-JiraConfigServer.md Configuration details for the Server parameter. ```yaml Type: Uri Parameter Sets: (All) Aliases: Uri Required: True Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False ``` -------------------------------- ### Get Jira Issue Create Metadata Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Get-JiraIssueCreateMetadata.md Retrieves the fields available for creating an issue of a specific type within a project. This is useful for understanding required fields. ```powershell Get-JiraIssueCreateMetadata -Project 'TEST' -IssueType 'Bug' ``` -------------------------------- ### Create a Jira Session with Credentials Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/about_JiraPS_Authentication.md Create a persistent Jira session using New-JiraSession with your credentials. This session is managed internally by JiraPS and does not need to be specified for subsequent commands. ```powershell $cred = Get-Credential 'powershell' New-JiraSession -Credential $cred ``` -------------------------------- ### Create a Jira session with a Personal Access Token Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/New-JiraSession.md Uses a Personal Access Token (PAT) passed via a custom Authorization header to authenticate the session. ```powershell $personalAccessToken = "" $headers = @{ Authorization = "Bearer $($personalAccessToken)" } New-JiraSession -Headers $headers Get-JiraIssue TEST-01 ``` -------------------------------- ### Update Jira Filter Description and JQL Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/Set-JiraFilter.md Modify the description and JQL of a Jira filter, and optionally mark it as a favorite. This example uses a hashtable for parameter input. ```powershell $filterData = @{ InputObject = Get-JiraFilter "12345" Description = "A new description" JQL = "project = TV AND type = Bug" Favorite = $true } Set-JiraFilter @filterData ``` -------------------------------- ### Bulk Create Jira Issues from CSV Source: https://github.com/atlassianps/jiraps/blob/master/docs/en-US/commands/New-JiraIssue.md Prepare issue data in a CSV file and pipe it to New-JiraIssue for bulk creation. The CSV header must match the parameter names or aliases. ```powershell "project,summary,assignee,IssueType,Priority,Description" > "./data.csv" "CS,Some Title 1,admin,Minor,1,Some Description 1" >> "./data.csv" "CS,Some Title 2,admin,Minor,1,Some Description 2" >> "./data.csv" import-csv "./data.csv" | New-JiraIssue ```