< Back

Get-JiraIssue

Thu Jan 16, 2020 7:53 am

NAME Get-JiraIssue



SYNOPSIS

Returns information about an issue in JIRA.





SYNTAX

Get-JiraIssue [-Key] <String[]> [-IncludeTotalCount] [-Skip <UInt64>] [-First <UInt64>] [-Credential

<PSCredential>] [<CommonParameters>]



Get-JiraIssue [-InputObject] <Object[]> [-IncludeTotalCount] [-Skip <UInt64>] [-First <UInt64>] [-Credential

<PSCredential>] [<CommonParameters>]



Get-JiraIssue -Query <String> [-StartIndex <UInt32>] [-MaxResults <UInt32>] [-PageSize <UInt32>]

[-IncludeTotalCount] [-Skip <UInt64>] [-First <UInt64>] [-Credential <PSCredential>] [<CommonParameters>]



Get-JiraIssue -Filter <Object> [-Fields <String[]>] [-StartIndex <UInt32>] [-MaxResults <UInt32>] [-PageSize

<UInt32>] [-IncludeTotalCount] [-Skip <UInt64>] [-First <UInt64>] [-Credential <PSCredential>] [<CommonParameters>]





DESCRIPTION

This function retrieves the data of a issue in JIRA.



This function can be used to directly query JIRA for a specific issue key or internal issue ID. It can also be

used to query JIRA for issues matching a specific criteria using JQL (Jira Query Language).



> For more details on JQL syntax, see this article from Atlassian:

https://confluence.atlassian.com/displa ... +Searching

(https://confluence.atlassian.com/displa ... +Searching)Output from this function can be piped to

various other functions in this module, including `Set-JiraIssue`, `Add-JiraIssueComment`, and

`Invoke-JiraIssueTransition`.





PARAMETERS

-Key <String[]>

Key of the issue to search for.



Required? true

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InputObject <Object[]>

Object of an issue to search for.



Required? true

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Query <String>

JQL query for which to search for.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Filter <Object>

Object of an existing JIRA filter from which the results will be returned.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Fields <String[]>

Field you would like to select from your issue. By default, all fields are returned.



Allowed values:



- `"*all"` - return all fields.



- `"*navigable"` - return navigable fields only.



- `"summary", "comment"` - return the summary and comments fields only.



- `"-comment"` - return all fields except comments.



- `"*all", "-comment"` - same as above



Required? false

Position? named

Default value "*all"

Accept pipeline input? False

Accept wildcard characters? false



-StartIndex <UInt32>

> NOTE: This parameter has been marked as deprecated and will be removed with the next major release. > Use

`-Skip` instead.



Index of the first issue to return.



This can be used to "page" through issues in a large collection or a slow connection.



Required? false

Position? named

Default value 0

Accept pipeline input? False

Accept wildcard characters? false



-MaxResults <UInt32>

> NOTE: This parameter has been marked as deprecated and will be removed with the next major release. > Use

`-First` instead.



Maximum number of results to return.



By default, all issues will be returned.



Required? false

Position? named

Default value 0

Accept pipeline input? False

Accept wildcard characters? false



-PageSize <UInt32>

How many issues should be returned per call to JIRA.



This parameter only has effect if `-MaxResults` is not provided or set to 0.



Normally, you should not need to adjust this parameter, but if the REST calls take a long time, try playing

with different values here.



Required? false

Position? named

Default value 25

Accept pipeline input? False

Accept wildcard characters? false



-IncludeTotalCount [<SwitchParameter>]

Causes an extra output of the total count at the beginning.



Note this is actually a uInt64, but with a custom string representation.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Skip <UInt64>

Controls how many things will be skipped before starting output.



Defaults to 0.



Required? false

Position? named

Default value 0

Accept pipeline input? False

Accept wildcard characters? false



-First <UInt64>

Indicates how many items to return.



Required? false

Position? named

Default value 18446744073709551615

Accept pipeline input? False

Accept wildcard characters? false



-Credential <PSCredential>

Credentials to use to connect to JIRA.

If not specified, this function will use anonymous access.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

[JiraPS.Issue] / [String]

- If a JiraPS.Issue object is passed, this function returns a new reference to the same issue.



- If a String is passed, this function searches for an issue with that issue key or internal ID.



- If an Object is passed, this function invokes its ToString() method and treats it as a String.





OUTPUTS

[JiraPS.Issue]







NOTES





This function requires either the `-Credential` parameter to be passed or a persistent JIRA session. See

`New-JiraSession` for more details. If neither are supplied, this function will run with anonymous access to

JIRA.



-------------------------- EXAMPLE 1 --------------------------



Get-JiraIssue -Key TEST-001



This example fetches the issue "TEST-001".



The default `Format-Table` view of a Jira issue only shows the value of "Key", "Summary", "Status" and "Created".

> This can be manipulated with `Format-Table`, `Format-List` and `Select-Object`

-------------------------- EXAMPLE 2 --------------------------



Get-JiraIssue "TEST-002" | Add-JiraIssueComment "Test comment from PowerShell"



This example illustrates pipeline use from `Get-JiraIssue` to `Add-JiraIssueComment`.

-------------------------- EXAMPLE 3 --------------------------



Get-JiraIssue -Query 'project = "TEST" AND created >= -5d'



This example illustrates using the `-Query` parameter and JQL syntax to query Jira for matching issues.

-------------------------- EXAMPLE 4 --------------------------



Get-JiraIssue -InputObject $oldIssue



This example illustrates how to get an update of an issue from an old result of `Get-JiraIssue` stored in

$oldIssue.

-------------------------- EXAMPLE 5 --------------------------



Get-JiraFilter -Id 12345 | Get-JiraIssue



This example retrieves all issues that match the criteria in the saved filter with id 12345.

-------------------------- EXAMPLE 6 --------------------------



Get-JiraFilter 12345 | Get-JiraIssue | Select-Object *



This prints all fields of the issue to the console.

-------------------------- Example 7 --------------------------



Get-JiraIssue -Query "project = TEST" -Fields "key", "summary", "assignee"



This example retrieves all issues in project "TEST" - but only the 3 properties listed above: key, summary and

assignee



By retrieving only the data really needed, the payload the server sends is reduced, which speeds up the query.



RELATED LINKS

Online Version: https://atlassianps.org/docs/JiraPS/com ... JiraIssue/

about_JiraPS_CreatingIssues

about_JiraPS_CustomFields

New-JiraIssue