Size: a a a

AUG for Developers

2018 November 21

a

alx in AUG for Developers
поделись кодом если есть возможность
источник

VK

Vladimir Kibe in AUG for Developers
а ты указываешь что твой запрос мультипарт дата?
источник

a

alx in AUG for Developers
server_url = "http://localhost:8080"
issue_key = "DJCP-16"

url = server_url + "/rest/api/2/issue/" + issue_key + "/attachments"

headers = {
  "X-Atlassian-Token": "nocheck",
  "Accept": "application/json",
  "Content-Type": "multipart/form-data"
}

multiple_files = {
       ('foo.txt', open('/home/alex/devel/python/foo.txt', 'rb')),
       ('bar.txt', open('/home/alex/devel/python/bar.txt', 'rb'))
}

response = requests.request(
  "POST",
  url,
  headers=headers,
  auth=HTTPBasicAuth('admin', '123'),
  files=multiple_files
)
источник

a

alx in AUG for Developers
вроде бы все указал
источник

VK

Vladimir Kibe in AUG for Developers
щя поищу
источник

VK

Vladimir Kibe in AUG for Developers
чет не нахожу(код щяс только есть в виде 1с
источник

a

alx in AUG for Developers
давай в 1С
источник

VK

Vladimir Kibe in AUG for Developers
щя
источник

VK

Vladimir Kibe in AUG for Developers
("Content-Type", "multipart/form-data; boundary="GUID") где гуид обычная строка,сгенерь набор символов
источник

VK

Vladimir Kibe in AUG for Developers
и попробуй
источник

A

Alexandr in AUG for Developers
@thankjura Юрий, добрый день. мы используем плагин tree custom field, пару дней назад обновились на третью версию и появилась ошибка при обновлении
источник

A

Alexandr in AUG for Developers
запрос: {"update":{"customfield_11690":[{"set":[{"name":"(73) город Москва-столица РФ"}]}]}}
источник

A

Alexandr in AUG for Developers
стэк: Database:
 - name:Oracle
 - version:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
 - minor version:2
Driver:
 - name:Oracle JDBC driver
 - version:12.1.0.1.0
java.sql.SQLSyntaxErrorException: ORA-00907: отсутствует правая скобка
 at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.find(EntityManagedActiveObjects.java:142)
 at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects.find(TenantAwareActiveObjects.java:296)
 ... 2 filtered
 at java.lang.reflect.Method.invoke(Method.java:498)
 at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
 at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
 at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
 at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
 at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
 at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
 at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
 at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
 at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
 at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
 at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
 at com.sun.proxy.$Proxy4059.find(Unknown Source)
 at ru.slie.jira.tree.admin.service.TreeOptionService.getByName(TreeOptionService.java:79)
 at ru.slie.jira.tree.manager.TreeSchemaManagerImpl.getOptionByName(TreeSchemaManagerImpl.java:115)
 at ru.slie.jira.tree.customfield.rest.TreeMultiCustomFieldOperationsHandler.getOptionIdForValue(TreeMultiCustomFieldOperationsHandler.java:123)
 at ru.slie.jira.tree.customfield.rest.TreeMultiCustomFieldOperationsHandler.handleSetOperation(TreeMultiCustomFieldOperationsHandler.java:81)
 at ru.slie.jira.tree.customfield.rest.TreeMultiCustomFieldOperationsHandler.handleSetOperation(TreeMultiCustomFieldOperationsHandler.java:24)
 at com.atlassian.jira.issue.customfields.impl.rest.AbstractCustomFieldOperationsHandler.updateIssueInputParameters(AbstractCustomFieldOperationsHandler.java:89)
источник

A

Alexandr in AUG for Developers
выносить в баг-трекер?
источник

a

alx in AUG for Developers
сейчас ошибки нет, код ответа 200, но и вложения к задаче не подгрузились
источник

a

alx in AUG for Developers
самое интересное что на https://developer.atlassian.com вобще ничего нет толкового по этому вопросу
источник

Ю

Юрий in AUG for Developers
Alexandr
выносить в баг-трекер?
да, сегодня посмотрю
источник

Ю

Юрий in AUG for Developers
спасибо
источник
2018 November 22

a

alx in AUG for Developers
у меня получилось закинуть вложение к задаче через рест апи, вот код кому интересно. Закидывает только один файл за раз, может кто знает как несколько файлов пульнуть за один раз?
источник

a

alx in AUG for Developers
#!/usr/bin/python
# -*- coding: utf-8 -*-

import requests
from requests_toolbelt.multipart.encoder import MultipartEncoder
from requests.auth import HTTPBasicAuth

server_url = "http://localhost:8080"
issue_key = "DJCP-15"

url = server_url + "/rest/api/2/issue/" + issue_key + "/attachments"

m = MultipartEncoder(
   fields={
     'file': ('foo.txt', open('/home/alex/devel/python/foo.txt', 'rb'), 'application/octet-stream')
           }
   )

headers = {
  "X-Atlassian-Token": "no-check",
  "Content-Type": m.content_type
}

resp = requests.request(
  "POST",
  url,
  data=m,
  headers=headers,
  auth=HTTPBasicAuth('admin', '123'),
)

print(resp.status_code)
print(resp.text)
источник