Sorry for the confusion. The "default to one of versions in Manage Versions 
page" is what I am trying to automate. I have a process to automatically 
generate versions via API, but we need to still manually mark them as 
"Default" instead of setting via API.

On Saturday, January 18, 2025 at 4:01:52 PM UTC-5 Jun Omae wrote:

> Hi,
>
> On 2025/01/14 0:16, Greg H wrote:
> > Anyone know how to set a version as "Default" (the default version for 
> new tickets) when creating or updating a version via XmlRpc API? There are 
> ticket.version.create and ticket.version.update methods that accept 
> 'attributes' so I'm guessing something can be passed in here to achieve 
> this?
>
> Try to omit "version" in the attributes parameter after setting default to 
> one of versions in Manage Versions page.
>
> [[[
> $ cat body.json
> {
> "id": 42,
> "method": "ticket.create",
> "params": [
> "summary",
> "description",
> {
> "type": "task",
> "priority": "minor"
> }
> ]
> }
>
> $ curl -s -u admin:password -H "Content-Type: application/json" \
> --data @body.json \
> http://192.168.11.122:3000/tracenv/login/rpc
> {"result": 3, "error": null, "id": 42}
>
> $ curl -s -u admin:password -H "Content-Type: application/json" \
> --data '{"method": "ticket.get", "params": [3]}' \
> http://192.168.11.122:3000/tracenv/login/rpc | jq -M
> {
> "result": [
> 3,
> {
> "__jsonclass__": [
> "datetime",
> "2025-01-18T20:48:52.485867"
> ]
> },
> {
> "__jsonclass__": [
> "datetime",
> "2025-01-18T20:48:52.485867"
> ]
> },
> {
> "summary": "summary",
> "reporter": "admin",
> "owner": "< default >",
> "description": "description",
> "type": "task",
> "status": "new",
> "priority": "minor",
> "milestone": "",
> "component": "",
> "version": "2.0", # <== The default version is used
> "resolution": "",
> "keywords": "",
> "cc": "",
> "time": {
> "__jsonclass__": [
> "datetime",
> "2025-01-18T20:48:52.485867"
> ]
> },
> "changetime": {
> "__jsonclass__": [
> "datetime",
> "2025-01-18T20:48:52.485867"
> ]
> },
> "_ts": "1737233332485867"
> }
> ],
> "error": null,
> "id": null
> }
> ]]]
>
> -- 
> Jun Omae <jun...@gmail.com> (大前 潤)
>

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/trac-users/1e8c46fc-2f0d-4549-bf05-1f0a08f8849an%40googlegroups.com.

Reply via email to