post data

This commit is contained in:
aarizona 2024-05-02 12:27:10 +03:00
parent f6937f8008
commit f69e47d303
1 changed files with 10 additions and 3 deletions

View File

@ -17,16 +17,23 @@ async def intgr(request: Request):
body = await request.json()
ref = body["ref"]
branch = ref.split("/")[-1]
[tag, number, *args] = branch.split("-")
logger.info(f"input tag {tag} number {number} args {args}")
if number == "test":
number = 423
bx_data = {
"taskId": number,
"fields": {
"POST_MESSAGE": body['commits'][0]['message']
},
}
bx_res = requests.get(
"https://crm.svs-tech.pro/rest/38/7ufrqnfpncmt279p/task.commentitem.add.json?"
f"taskId={number}&fields[POST_MESSAGE]=f'{body['commits'][0]['message']}'"
"https://crm.svs-tech.pro/rest/38/7ufrqnfpncmt279p/task.commentitem.add.json",
json=bx_data
)
logger.info(f"result {json.loads(bx_res.text)}")
return {"status": "success"}