payload: {"action":"created","issue":{"url":"https://api.github.com/repos/MISP/PyMISP/issues/503","repository_url":"https://api.github.com/repos/MISP/PyMISP","labels_url":"https://api.github.com/repos/MISP/PyMISP/issues/503/labels{/name}","comments_url":"https://api.github.com/repos/MISP/PyMISP/issues/503/comments","events_url":"https://api.github.com/repos/MISP/PyMISP/issues/503/events","html_url":"https://github.com/MISP/PyMISP/issues/503","id":531044624,"node_id":"MDU6SXNzdWU1MzEwNDQ2MjQ=","number":503,"title":"Could not add Attribute (add_attribute)","user":{"login":"ClaraMS","id":24474498,"node_id":"MDQ6VXNlcjI0NDc0NDk4","avatar_url":"https://avatars2.githubusercontent.com/u/24474498?v=4","gravatar_id":"","url":"https://api.github.com/users/ClaraMS","html_url":"https://github.com/ClaraMS","followers_url":"https://api.github.com/users/ClaraMS/followers","following_url":"https://api.github.com/users/ClaraMS/following{/other_user}","gists_url":"https://api.github.com/users/ClaraMS/gists{/gist_id}","starred_url":"https://api.github.com/users/ClaraMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClaraMS/subscriptions","organizations_url":"https://api.github.com/users/ClaraMS/orgs","repos_url":"https://api.github.com/users/ClaraMS/repos","events_url":"https://api.github.com/users/ClaraMS/events{/privacy}","received_events_url":"https://api.github.com/users/ClaraMS/received_events","type":"User","site_admin":false},"labels":[{"id":751218849,"node_id":"MDU6TGFiZWw3NTEyMTg4NDk=","url":"https://api.github.com/repos/MISP/PyMISP/labels/Support","name":"Support","color":"efbf6b","default":false,"description":null}],"state":"open","locked":false,"assignee":{"login":"Rafiot","id":248875,"node_id":"MDQ6VXNlcjI0ODg3NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/248875?v=4","gravatar_id":"","url":"https://api.github.com/users/Rafiot","html_url":"https://github.com/Rafiot","followers_url":"https://api.github.com/users/Rafiot/followers","following_url":"https://api.github.com/users/Rafiot/following{/other_user}","gists_url":"https://api.github.com/users/Rafiot/gists{/gist_id}","starred_url":"https://api.github.com/users/Rafiot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rafiot/subscriptions","organizations_url":"https://api.github.com/users/Rafiot/orgs","repos_url":"https://api.github.com/users/Rafiot/repos","events_url":"https://api.github.com/users/Rafiot/events{/privacy}","received_events_url":"https://api.github.com/users/Rafiot/received_events","type":"User","site_admin":false},"assignees":[{"login":"Rafiot","id":248875,"node_id":"MDQ6VXNlcjI0ODg3NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/248875?v=4","gravatar_id":"","url":"https://api.github.com/users/Rafiot","html_url":"https://github.com/Rafiot","followers_url":"https://api.github.com/users/Rafiot/followers","following_url":"https://api.github.com/users/Rafiot/following{/other_user}","gists_url":"https://api.github.com/users/Rafiot/gists{/gist_id}","starred_url":"https://api.github.com/users/Rafiot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rafiot/subscriptions","organizations_url":"https://api.github.com/users/Rafiot/orgs","repos_url":"https://api.github.com/users/Rafiot/repos","events_url":"https://api.github.com/users/Rafiot/events{/privacy}","received_events_url":"https://api.github.com/users/Rafiot/received_events","type":"User","site_admin":false}],"milestone":null,"comments":6,"created_at":"2019-12-02T10:47:08Z","updated_at":"2019-12-03T09:21:57Z","closed_at":null,"author_association":"NONE","body":"Hi, \r\n\r\nI'm trying to add multiple events to misp with multiple attributes and misp objects but when I try to add 2 or more attributes with the same value it fails with the following error:\r\n\r\n> ERROR [aping.py:2158 - _check_response() ] Something went wrong (403): {'name': 'Could not add Attribute', 'message': 'Could not add Attribute', 'url': '/attributes/add', 'errors': {'value': ['A similar attribute already exists for this event.']}}\r\n\r\nThis happens too with duplicated attributes in MISPObjects:\r\n\r\n> ERROR [aping.py:2158 - _check_response() ] Something went wrong (403): {'name': 'Could not add object', 'message': 'Could not add object', 'url': '/objects/add/1757/', 'errors': 'Could not save object as at least one attribute has failed validation (text). {\"uuid\":[\"The UUID provided is not unique\"]}'}\r\n\r\n\r\nThis is part of my code:\r\n\r\n```\r\ndef create_attribute(type,value,category,comment):\r\n    attribute = MISPAttribute()\r\n    attribute.type = type\r\n    attribute.value = value\r\n    attribute.category = category\r\n    attribute.comment = comment\r\n\r\n    return attribute\r\napi = ExpandedPyMISP('https://x.x.x.x.', 'xxxx', ssl=False, debug=None, proxies=None, cert=None)\r\n event = api.new_event(0,4,0,(\"[Event]\"+ \" \" + \"Event example))\r\n\r\n# for loop\r\napi.add_attribute(event,create_attribute('other',str(key['Name']),'Artifacts dropped',str('DELETED')))\r\nmisp_object = MISPObject('file', standalone=False)\r\nmisp_object.add_attribute('path', value=str(key['sources'][source]['@process']))\r\nmisp_object.add_attribute('filename', value=str(key['@desc']))\r\nmisp_object.add_attribute('text', value=str(key['sources'][source]['$']))\r\nmisp_object.add_attribute('text', value=str('null'))\r\n\r\nresponse = api.add_object(event,misp_object)\r\n\r\n# outside the for loop \r\nadd_event = api.add_event(event)\r\n\r\n```\r\n\r\nThis code is inside a for loop, thats the reason why I have and want repeated attributes, some of them have different categories or comments even if the value is the same.\r\n\r\nI've checked this issue which looks similar to mine: https://github.com/MISP/MISP/issues/3897 \r\nBut the issue is not a warning now, is an ERROR causing the attribute not being added to the event, so none of those examples are valid anymore.\r\n\r\nI'm using the last version of PyMisp and python 3.6\r\nMaybe I'm not using it the right way :/"},"comment":{"url":"https://api.github.com/repos/MISP/PyMISP/issues/comments/561075381","html_url":"https://github.com/MISP/PyMISP/issues/503#issuecomment-561075381","issue_url":"https://api.github.com/repos/MISP/PyMISP/issues/503","id":561075381,"node_id":"MDEyOklzc3VlQ29tbWVudDU2MTA3NTM4MQ==","user":{"login":"ClaraMS","id":24474498,"node_id":"MDQ6VXNlcjI0NDc0NDk4","avatar_url":"https://avatars2.githubusercontent.com/u/24474498?v=4","gravatar_id":"","url":"https://api.github.com/users/ClaraMS","html_url":"https://github.com/ClaraMS","followers_url":"https://api.github.com/users/ClaraMS/followers","following_url":"https://api.github.com/users/ClaraMS/following{/other_user}","gists_url":"https://api.github.com/users/ClaraMS/gists{/gist_id}","starred_url":"https://api.github.com/users/ClaraMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClaraMS/subscriptions","organizations_url":"https://api.github.com/users/ClaraMS/orgs","repos_url":"https://api.github.com/users/ClaraMS/repos","events_url":"https://api.github.com/users/ClaraMS/events{/privacy}","received_events_url":"https://api.github.com/users/ClaraMS/received_events","type":"User","site_admin":false},"created_at":"2019-12-03T09:21:57Z","updated_at":"2019-12-03T09:21:57Z","author_association":"NONE","body":"Oh, I see... OK I think now I have more clear the purpose of some of the functions of PyMISP and what can I do or can not.\r\n\r\nThank you very much for your help! :)"}}
other: {"actor":{"display_login":"ClaraMS"}}