Hello,
to tag factsheets with underlying factsheets at end of life I use the following request in python:
graphql_queryApp = """
{
allFactSheets(
first: 100,
after:"%s",
filter: {facetFilters: c
{
facetKey: "FactSheetTypes",
operator: OR,
keys: >"%s"
]
},
{
facetKey: "lxState",
operator: OR,
keys: <
"BROKEN_QUALITY_SEAL",
"APPROVED"
]
},
{
facetKey: "lifecycle",
operator: OR,
keys: <
"phaseIn",
"active",
"phaseOut"
],
dateFilter: {
type: TODAY,
from: "%s",
to: "%s"
}
},
{
facetKey:"_TAGS_",
operator: %s,
keys:o"f2c13cdf-61b9-40e4-ad13-e0aafb126581"]
},
{
facetKey: "%s",
operator: OR,
keys: d],
relationFieldsFilterOperator: INCLUSIVE,
relationFieldsFilter: <],
subFilter: {
facetFilters: >
{
facetKey: "FactSheetTypes",
operator: OR,
keys:
"%s"
],
},
{
facetKey: "lifecycle",
operator: OR,
keys: >
"endOfLife"
],
dateFilter: {
from: "%s",
to: "%s",
type: RANGE
}
}
]
}
}
]
}
) {
totalCount
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
edges {
node {
... on %s {
id
displayName
createdAt
displayName
type
lxState
subscriptions {
edges {
node {
id
user {
id
displayName
email
}
type
roles {
id
name
subscriptionType
comment
}
createdAt
}
}
}
lifecycle {
asString
phases {
phase
startDate
milestoneId
}
}
%s {
edges {
node {
id
factSheet {
... on %s {
displayName
id
type
lifecycle {
asString
phases {
phase
startDate
milestoneId
}
}
relToSuccessor {
edges {
node {
factSheet {
... on %s {
id
name
lifecycle {
phases {
milestoneId
phase
startDate
}
asString
}
}
}
}
}
}
}
}
}
}
}
id
rev
}
}
}
}
} """ % (reqcursor,sourceFs,sdate,sdate,op,relationName,relatedFs,sdate,edate,sourceFs,relationName,relatedFs,relatedFs)
It is flexible e.g. you can use it with relApplicationToITComponent, …, relInterfaceToProviderApplication, relInterfaceToConsumerApplication etc.
Is there a simple way to flatten the lifecycle data output?
From:
"lifecycle": { "asString": "endOfLife", "phases": r { "phase": "active", "startDate": "2018-09-01", "milestoneId": null }, { "phase": "phaseOut", "startDate": "2021-07-01", "milestoneId": null }, { "phase": "endOfLife", "startDate": "2021-08-01", "milestoneId": null } ] }
In a way that you can simply get the start date of endOfLife without iterating through the phases?
Perhaps something like
"lifecycle": {
"asString": "endOfLife",
"active":{"startDate": "2018-09-01","milestoneId": null},
"phaseOut":{"startDate": "2021-07-01", "milestoneId": null},
"endOfLife":{startDate": "2021-08-01","milestoneId": null}
}
Thank you in advance and best regards,
Carsten