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,366,634
Community Members
 
Community Events
168
Community Groups

API - Updating a lifeCycleStateId on a Theme doesn't work in some cases

I'm running into an API issue where I cannot add or update the lifeCycleStateId field on a Theme object if that Theme was created through the API.

Normally when I PATCH

[{"value":"40","path":"lifeCycleStateId","op":"replace"}]

 I get an an 400 error: "Cannot update theme with id 78507. Value for lifeCycleStateId is invalid." even when I've ensured that the programId field is correctly set. If I create or save the Theme through the web UI, then the exact same API call will go through. Is this an API defect?

1 answer

1 accepted

0 votes
Answer accepted
Roman Atlassian Team Apr 27, 2021

Hi Leo!
It's a known issue. We've already partially fixed it and the fix goes into 10.93.
For now, the existing problem that's not fixed yet is:
- Process steps are directly dependent on the primary program across all work items
- In the case of Themes we don't have an explicitly defined primary program (We've got a list of 'Programs' that are kind of equal)

- In UI the program that goes last on the list is considered as the primary one. 

- In API the program that goes first on the list is considered as a primary.
It means that all your process steps will be always validated against that 'primary program and you always need to take it into account. If you want to change the 'virtual status' of any program to be primary you need:
Via UI - Delete all programs from the dropdown and that add those in the way that the potential 'primary program' goes last. Then choose needed process steps from the appropriate dropdown(s).
Via API - Since the program with index 0 (eventually the first one in the list) is a primary, you need to put any program you want to be a primary as the first. You can do it either by swapping a program that goes first with a program you want to be the first via PUT method or doing pretty much the same via PATCH.

Anyway, as I mentioned above, the issue is fixed in general and you should be able to successfully PUT/PATCH a Theme updating process steps in the case when your theme has only one program. If a theme is assigned to 2+ programs, please try to follow those workarounds.

Thanks Roman. I'm still seeing this issue when trying to write to a Theme with only a single Program assigned to it. I should add that I am developing against a test environment of Align that is reporting as version 10.93.

Roman Atlassian Team Apr 28, 2021

Yes, unfortunately, yesterday we realized that there's still a gap in our temporary fix. We've tracked it as a new defect and are going to fix it in 10.94.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events