I am currently unable to write to a subitems column. If you know, change_multiple_columns would be preferred. The examples of the documentation do not help me as the devil is in the json formatting and parameter passing. If you know a python code that works for this, I would be so happy.
Among 3000 versions, I tried the following:
sub_data = {
"url": "http://example.com",
"text": "website"
}
mutation_query = '''
mutation(
$itemId: ID!,
$boardId: ID!,
$columnId: String!,
$colValue: JSON!) {
change_column_value(
item_id: $itemId,
board_id: $boardId,
column_id: $columnId,
value: $colValue) {
id
}
}
'''
response = requests.post(params["api-url"], headers=headers,
json={
"query": mutation_query,
"variables": {
"itemId": int(sub_id),
"boardId": int(sub_board_id),
"columnId": "link",
"colValue": json.dumps(sub_data)
}
}
)
To get the subitem board id, I used the following:
query = """
query {
items (ids: %i) {
parent_item {
id
}
}
}
""" % (int(sub_id))
response = requests.post(params["api-url"], headers=headers,
json={"query": query})
The error is response.status 500, the html with “We are having technical issues
Please visit our Status Page for updates. We apologize for any inconvenience.” although the status website shows that everything should be ok