Closed msacademy closed 6 years ago
$fields = @{ duedate = '2017-10-01' }
I am on my phone, but as I recall it should look like that
That works. Thank you. I had been creating a hash.
[Humach]
Randy Schmidt
Director of IT
wk: 641.243.8293 ext. 6625
www.humach.comhttp://www.humach.com
From: Oliver Lipkau notifications@github.com Sent: Friday, September 15, 2017 5:25:00 PM To: AtlassianPS/JiraPS Cc: Randy Schmidt; Author Subject: Re: [AtlassianPS/JiraPS] Set-Jiraissue will not allow duedate and -fields cannot help (is it a string or date format?) (#173)
$fields = @{ duedate = '2017-10-01' }
I am on my phone, but as I recall it should look like that
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/AtlassianPS/JiraPS/issues/173#issuecomment-329917991, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AJK6fOCB4HQ6_3695nmAWm2eKZGUFrDKks5sivk8gaJpZM4PZb_A.
Expected Behavior
Duedate for an new issue is not allowed directly. So following the doc, I made a $fields for it to pass with -fields. I expected it to update the due date. $fields = @{ duedate = @{ value = $dateformat } }
Current Behavior
The cmdlet says it must be a string value: set-jiraissue ITSUP-5041 -fields $fields WARNING: JIRA returned HTTP error 400 - BadRequest Resolve-JiraError : Jira encountered an error: [duedate] - # Operation value must be a string**** At C:\Program Files\WindowsPowerShell\Modules\JiraPS\2.1.0.90\Internal\Invoke-JiraMethod.ps1:112 char:13
However, the duedate ID says it should be date format:
ID : duedate Searchable : True Schema : @{type=date; system=duedate} Name : Due Date Custom : False Navigable : True Orderable : True ClauseNames : {due, duedate}
That is why in $fields I made it a date formatted field. If I change $fields to be a string:
$fields = @{ duedate = @{ value = '2017-10-01' } }
I still get the "must be a string error::
set-jiraissue ITSUP-5041 -fields $fields WARNING: JIRA returned HTTP error 400 - BadRequest Resolve-JiraError : Jira encountered an error: [duedate] - Operation value must be a string At C:\Program Files\WindowsPowerShell\Modules\JiraPS\2.1.0.90\Internal\Invoke-JiraMethod.ps1:112 char:13
Possible Solution
Fix the bug that thinks it should be a string if it says the format is "date".
Steps to Reproduce (for bugs)
Commands are listed above.
Context
I am trying to auto create daily issues that are created for compliance tasks. This will save admin time by creating the issue and making it due to same day. We have several every morning.
Your Environment
Get-Module JiraPS -ListAvailable | select version
Version
2.2.0.141 2.1.0.90 2.2.0.141 2.1.0.90
Name Value
PSVersion 5.0.10586.117
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.10586.117
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1