Comments (3)
Like something here?
https://wekan.github.io/api/v7.30/#wekan-rest-api-customfields
from wekan.
Like something here?
https://wekan.github.io/api/v7.30/#wekan-rest-api-customfields
Stil missing a way to assign a custom field to a card. I can update and edit its value, but not assign
from wekan.
`
if sys.argv[1] == 'addcardmultiplelabel':
# ------- ADD CARD START -----------
authorid = sys.argv[2]
boardid = sys.argv[3]
swimlaneid = sys.argv[4]
listid = sys.argv[5]
cardtitle = sys.argv[6]
carddescription = sys.argv[7]
cardtolist = wekanurl + apiboards + boardid + s + l + s + listid + s + cs
# Add card
headers = {'Accept': 'application/json', 'Authorization': 'Bearer {}'.format(apikey)}
post_data = {'authorId': '{}'.format(authorid), 'title': '{}'.format(cardtitle), 'description': '{}'.format(carddescription), 'swimlaneId': '{}'.format(swimlaneid)}
body = requests.post(cardtolist, data=post_data, headers=headers)
response_json = body.json()
cardid = response_json.get('_id')
print("Card added with ID:", cardid)
# ------- ADD CARD END -----------
# ------- ADD LABEL START -----------
label_ids = sys.argv[8:12]
for label_id in label_ids:
if label_id:
print("Processing Label ID:", label_id)
addlabel_command = "python3 api.py addlabel {} {} {} {}".format(BOARDID, LISTID, cardid, label_id)
subprocess.run(addlabel_command, shell=True)
print("Label added to card:", label_id)
# ------- ADD LABEL END -----------
custom_fields = sys.argv[12:]
for custom_field in custom_fields:
if custom_field and ':' in custom_field:
customfieldid, customfieldvalue = custom_field.split(':', 1)
edfield = wekanurl + apiboards + BOARDID + s + l + s + LISTID + s + cs + s + cardid + s + 'customFields' + s + customfieldid
print("Processing CustomField ID:", customfieldid)
print("Processing CustomField Value:", customfieldvalue)
editcustomfield_command = "python3 api.py editcustomfield {} {} {} {}".format(boardid, listid, cardid, customfieldid)
subprocess.run(editcustomfield_command, shell=True)
# Creare il payload per la richiesta PUT con il solo valore del campo personalizzato
put_data = {'_id': '{}'.format(customfieldid), 'value': '{}'.format(customfieldvalue)}
print("PUT Request JSON Data:", put_data)
body = requests.put(edfield, json=put_data, headers=headers)
print("PUT Request Status Code:", body.status_code)
print("PUT Request Response:", body.text)
print(f"Custom field {customfieldid} updated on card with value:", customfieldvalue)
`
Processing CustomField ID: Zef6syZ6EHaHaNSqY
Processing CustomField Value: 22
PUT Request JSON Data: {'_id': 'Zef6syZ6EHaHaNSqY', 'value': '22'}
PUT Request Status Code: 405
PUT Request Response:
Custom field Zef6syZ6EHaHaNSqY updated on card with value: 22
but if is not assigned, doesnt appear on card.
from wekan.
Related Issues (20)
- Attachment cannot be handled correctly, because port number for attachment is missing HOT 2
- Error when deleting attachment from card
- Rule uncheck all Checklist does not work TypeError: Cannot read property 'uncheckAllItems' of undefined
- Docker-Image 7.30 from wekanteam/wekan has user assignment bug HOT 4
- Api.py Label HOT 7
- Add Attachments PDF or Image from api.py request HOT 1
- Adding more labels in one command HOT 3
- Activities Filter HOT 5
- Labels and Duplicate api.py integrations HOT 1
- Add function to edit board title through api.py HOT 2
- Error 500 when adding user to a board HOT 10
- edit card using api HOT 8
- Question about checklist in card HOT 4
- User roles edit HOT 1
- Feature Request: Shortcut to filter Cards assigned to current user
- People list (administrator shown many, many times) HOT 1
- API get_all_cards doesn't return SwimlaneId HOT 6
- Generating WeKan 7.32 OpenAPI docs does not work
- Bug when archiving card HOT 21
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wekan.