I'm looking for a way to create a new issue which can be called from an older version of Jenkins. Scenario is simple - in the case of a build error create a new ticket.
Because of the Jenkins version I have decided to use the Jenkins PostBuild Script plugin. I'm also using the JiraPS powershell module. This contains a New-JiraSession function which takes a PSCredential Object....so New-JiraSession -Credential <PSCredential>
Since this is only for a demo initially I simply store the pw in a secure string..
$username = "MyName"
$pwd = Get-Content C:\TEMP\cred.txt | ConvertTo-SecureString
$jiraCredentialObject = New-Object System.Management.Automation.PSCredential($username,$pwd)
New-JiraSession -Credential $jiraCredentialObject
I use a cmd wrapper to start the PS Script from Jenkins since it's not capable of triggering directy. It works fine and runs through creating the ticket in PowerShell ISE and also in the PS Terminal....Being called from Jenkins however causes a Windows credentials dialog to appear although PS is being called "non-interactive". I also deliberately use New-Object and to create my own new CredentialObject not Get-Credential which is interactive and definitely pops the dialog interrupting the ticket creation....
This may be a Windows (shell) problem and sorry if this is off-topic. On the off-chance that someone in the community has used PS with JIRA before - would be grateful for any ideas
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.