Skip to main content
Solved

Create a new Initiative Facsheet with a subtype of 'Project' using GraphQL

  • October 16, 2024
  • 1 reply
  • 204 views

Forum|alt.badge.img

Has anyone used GraphQL to create a new factsheet with a specific subtype?  I cannot seem to get the syntax correct.  Thanks in advance.

Best answer by jnader

Hi Jeff,

Here’s a small GraphQL snippet to create a new factsheet. Please check the variable value for Initiative in your metamodel. In environments that moved from metamodel v3 to v4, Initiative may still be Project.

Also, Subproject can be added using the "category" variable. I’ve attached the image of the GraphQL result for reference.

 

mutation {
createFactSheet(input: {name:"InititativeByGraphQL", type: Project},
patches: [ {op: replace, path: "/description", value: "Test Description"},
{op: replace, path:"/lifecycle/active" value: "2024-12-13"},
{op: replace, path: "/category", value: "project"},
]
) {
factSheet {
id
name
rev
type
}
}
}

 

 

Regards,

Jorge Nader.

1 reply

Forum|alt.badge.img
  • Rookie
  • Answer
  • October 16, 2024

Hi Jeff,

Here’s a small GraphQL snippet to create a new factsheet. Please check the variable value for Initiative in your metamodel. In environments that moved from metamodel v3 to v4, Initiative may still be Project.

Also, Subproject can be added using the "category" variable. I’ve attached the image of the GraphQL result for reference.

 

mutation {
createFactSheet(input: {name:"InititativeByGraphQL", type: Project},
patches: [ {op: replace, path: "/description", value: "Test Description"},
{op: replace, path:"/lifecycle/active" value: "2024-12-13"},
{op: replace, path: "/category", value: "project"},
]
) {
factSheet {
id
name
rev
type
}
}
}

 

 

Regards,

Jorge Nader.