I am using a PowerShell script to read in issue details like Summary and Description. For each PSObject in my array I want to call the acli.bat to create an issue. Everything works except for multi-line descriptions. Only the first line is ever output to my generated ticket. Here is a code sample...
Import-Csv -Path ".\issues.csv" | ForEach-Object {
.\acli.bat --action createIssue `
--server "$server" `
--user "$user`
--password "$password`
--project TEST `
--type Task `
--summary $_.Summary `
--description $_.Description `
}
While I have used runFromCsv in other projects to import tickets, even those with multiple line descriptions, I do not want to directly runFromCsv in this case as I need to make modifications on the fly.
How do I do this?
I am using Jira Software (Server) 8.5 and the Atlassian CLI 9.2
I have found a solution.
The full setup is then
Import-Csv -Path ".\issues.csv" | ForEach-Object {
$_.Description | Set-Content -Path ".\desc.txt" -Encoding "UTF8"
.\acli.bat --action createIssue `
--server "$server" `
--user "$user`
--password "$password`
--project TEST `
--type Task `
--summary $_.Summary `
--file ".\desc.txt
}
This add a fair bit more file I/O to my operation as we write this for every record we're making and I have hundreds of tickets to make (porting). I'll need to do this for comments too assuming the --file method works on comments.
I'm glad you found a solution. Understand about the file IO. RunFromCSV or Run with a file containing a line for each action is the supported method, but I understand that won't work for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ryan_Taylor - Have you tried wrapping $_.Description in double quotes (") so that it get's passed intact to acli.bat?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately that does not work. I also tried "$($_.Description)" with no success.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.