GraphQL Query: Retrieving Custom Field Values for Specific Projects #102740
Unanswered
mororyou
asked this question in
API and Webhooks
Replies: 1 comment
-
My python working example: query = """
query {{
node(id: "{pnid}") {{
... on ProjectV2 {{
id
title
items(first: {pagination}{cursor}) {{
totalCount
pageInfo {{
startCursor
endCursor
hasNextPage
hasPreviousPage
}}
nodes {{
id
content {{
... on Issue {{
id
title
body
url
number
state
author {{
url
}}
labels(first: 5) {{
nodes {{
name
}}
}}
body
}}
}}
fieldValues(first: 50) {{
__typename
totalCount
pageInfo {{
startCursor
endCursor
hasNextPage
hasPreviousPage
}}
nodes {{
__typename
... on ProjectV2ItemFieldSingleSelectValue {{
id
name
createdAt
updatedAt
optionId
description
field {{
... on ProjectV2SingleSelectField {{
id
name
}}
}}
}}
... on ProjectV2ItemFieldTextValue {{
id
text
createdAt
updatedAt
field {{
... on ProjectV2Field {{
id
name
}}
}}
}}
... on ProjectV2ItemFieldDateValue {{
id
date
createdAt
updatedAt
field {{
... on ProjectV2Field {{
id
name
}}
}}
}}
... on ProjectV2ItemFieldLabelValue {{
labels(first: 10) {{
nodes {{
id
name
updatedAt
}}
}}
field {{
... on ProjectV2Field {{
id
name
}}
}}
}}
... on ProjectV2ItemFieldRepositoryValue {{
repository {{
id
name
createdAt
updatedAt
}}
field {{
... on ProjectV2Field {{
id
name
}}
}}
}}
... on ProjectV2ItemFieldNumberValue {{
id
number
createdAt
updatedAt
field {{
... on ProjectV2Field {{
id
name
}}
}}
}}
}}
}}
}}
}}
}}
}}
}}
""".format(pnid=project_node_id, pagination=pagination, cursor=cursor) Note: Change the double curly brackets to single. I am using a formatter. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Select Topic Area
Question
Body
Hello,
I'm currently searching for the appropriate GraphQL query to retrieve the values of custom fields added to a project.
I managed to retrieve the values using the following query. However, I'm unable to specify the project.
When I specify the project using
ProjectV2
as shown below, I'm unable to retrieve the value:Is it possible to retrieve custom fields by specifying the project? Any guidance on this matter would be greatly appreciated. Thank you.
Beta Was this translation helpful? Give feedback.
All reactions