Custom Fields created via API don't appear on new tickets

I'm having an issue where custom fields I'm creating via the API aren't appearing on new tickets as I would expect them to. This JSON is the result of querying my custom fields via the API, the first record having been created by the API and the second manually. When I create a new task in the (ID 'IEAE5CVJI4YSTAUN') space, I see the second custom field but not the first. Let me know where I'm going wrong.

Thanks,
Scott

          {'accountId': 'IEAE5CVJ',
           'id': 'IEAE5CVJJUACTVMY',
           'settings': {'inheritanceType': 'All', 'readOnly': False},
           'sharedIds': [],
           'spaceId': 'IEAE5CVJI4YSTAUN',
           'title': 'clientName',
           'type': 'Text'}

          {'accountId': 'IEAE5CVJ',
           'id': 'IEAE5CVJJUACTVON',
           'settings': {'inheritanceType': 'All', 'readOnly': False},
           'sharedIds': [],
           'spaceId': 'IEAE5CVJI4YSTAUN',
           'title': 'projectName',
           'type': 'Text'}


And here's what my query to create a custom field looks like.

import httpx
import os
from dotenv import load_dotenv
from pprint import pprint


# Load the bearer token from .env
load_dotenv()
BEARER_TOKEN = os.getenv("WRIKE_BEARER_TOKEN")
HEADERS = {"Authorization": "bearer " + BEARER_TOKEN}

url = "https://app-us2.wrike.com/api/v4"


def main():
    # Add clientName customField
    query = "/customfields"
    data = {
        "title": "clientName",
        "type": "Text",
        "spaceId": "IEAE5CVJI4YSTAUN",
    }
    type = "POST"

    r = httpx.post(url + query, headers=HEADERS, data=data)

    pprint(r.json())


if __name__ == "__main__":
    main()

0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos
1 комментарий
Avatar
Cansu

Hi Scott Larsen, welcome to the Community, and thank you for posting! I see that you're in touch with our Support agents already. Please let me know if I can help you with anything else🙋🏻‍♀️

0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos

Folllowing List for Post: Custom Fields created via API don't appear on new tickets
[this list is visible for admins and agents only]

Вверх
Didn’t find what you were looking for? Write new post