Model Context Protocol (MCP) finally gives AI models a way to access the business data needed to make them really useful at work. CData MCP Servers have the depth and performance to make sure AI has access to all of the answers.
Try them now for free →Automate Jira Integration Tasks from PowerShell
Are you in search of a quick and easy way to access Jira data from PowerShell? This article demonstrates how to utilize the Jira Cmdlets for tasks like connecting to Jira data, automating operations, downloading data, and more.
The CData Cmdlets for Jira are standard PowerShell cmdlets that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to Jira.
About Jira Data Integration
CData simplifies access and integration of live Jira data. Our customers leverage CData connectivity to:
- Gain bi-directional access to their Jira objects like issues, projects, and workflows.
- Use SQL stored procedures to perform functional actions like changing issues status, creating custom fields, download or uploading an attachment, modifying or retrieving time tracking settings, and more.
- Authenticate securely using a variety of methods, including username and password, OAuth, personal access token, API token, Crowd or OKTA SSO, LDAP, and more.
Most users leverage CData solutions to integrate Jira data with their database or data warehouse, whether that's using CData Sync directly or relying on CData's compatibility with platforms like SSIS or Azure Data Factory. Others are looking to get analytics and reporting on live Jira data from preferred analytics tools like Tableau and Power BI.
Learn more about how customers are seamlessly connecting to their Jira data to solve business problems from our blog: Drivers in Focus: Collaboration Tools.
Getting Started
PowerShell Cmdlets or ADO.NET Provider?
The Cmdlets are not only a PowerShell interface to Jira, but also an SQL interface; this tutorial shows how to use both to retrieve Jira data. We also show examples of the ADO.NET equivalent, which is possible with the CData ADO.NET Provider for Jira. To access Jira data from other .NET applications, like LINQPad, use the CData ADO.NET Provider for Jira.
Once you have acquired the necessary connection properties, accessing Jira data in PowerShell can be enabled in three steps.
To connect to JIRA, provide the User and Password. Additionally, provide the Url; for example, https://yoursitename.atlassian.net.
PowerShell
-
Install the module:
Install-Module JIRACmdlets
-
Connect:
$jira = Connect-JIRA -User "$User" -Password "$Password" -Url "$Url"
-
Search for and retrieve data:
$reporterdisplayname = "Bob" $issues = Select-JIRA -Connection $jira -Table "Issues" -Where "ReporterDisplayName = `'$ReporterDisplayName`'" $issues
You can also use the Invoke-JIRA cmdlet to execute SQL commands:
$issues = Invoke-JIRA -Connection $jira -Query 'SELECT * FROM Issues WHERE ReporterDisplayName = @ReporterDisplayName' -Params @{'@ReporterDisplayName'='Bob'}
ADO.NET
-
Load the provider's assembly:
[Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for Jira\lib\System.Data.CData.JIRA.dll")
-
Connect to Jira:
$conn= New-Object System.Data.CData.JIRA.JIRAConnection("User=admin;Password=123abc;Url=https://yoursitename.atlassian.net;") $conn.Open()
-
Instantiate the JIRADataAdapter, execute an SQL query, and output the results:
$sql="SELECT Summary, TimeSpent from Issues" $da= New-Object System.Data.CData.JIRA.JIRADataAdapter($sql, $conn) $dt= New-Object System.Data.DataTable $da.Fill($dt) $dt.Rows | foreach { Write-Host $_.summary $_.timespent }