GraphQL Query: Retrieving Custom Field Values for Specific Projects #102740
Replies: 2 comments
-
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.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
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