Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,551,706
Community Members
 
Community Events
184
Community Groups

Cant set custom field singe-select value

Hello,

Im using JiraPS powershell module to interact with the tickets. I need to set a customfield value, the type is single-select. My syntax is exactly as described in the guide here https://atlassianps.org/docs/JiraPS/about/custom-fields.html


 $field = @{
customfield_17700 = { id = 40409 }
}


or


$field = @{
customfield_17700 = { value = "Myvalue" }
}

But I always get this error:

Invoke-JiraMethod :
customfield_17700
-----------------
Could not find valid 'id' or 'value' in the Parent Option object.
At C:\lm\scripts\jira\lib\JiraPS.psm1:5505 char:21
+ Invoke-JiraMethod @parameter
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidResult: (:) [Invoke-JiraMethod], RuntimeException
+ FullyQualifiedErrorId : InvalidResponse.Status400,Invoke-JiraMethod

 

Any help would be appreciated.

Thanks

2 answers

1 accepted

1 vote
Answer accepted

Problem solved. Syntax has to be a like this (new hash table inside the field)

$field = @{'customfield_17700' = @{ id = '40410'}}

This is missing in the documentation above.

Cheers Leos

0 votes
Ken McClean
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 22, 2023

I haven't used the JiraPS module much, but should you be using dot notation?  In Groovy or Python, I'd expect to have to reference it something like issue.parent.id

Hi Ken,

if you check the link I provided, it say to use the notation that I use. It works well for text field, like

$field = @{

customfield_17700 = "MyText"

}

However if the field is single-select, I cant update it still. Trying some options, but not successful yet.

Suggest an answer

Log in or Sign up to answer