Skip to content

Commit

Permalink
Add an example of creation object
Browse files Browse the repository at this point in the history
  • Loading branch information
gonchik committed Sep 7, 2023
1 parent 4ed0d44 commit 176da86
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion atlassian/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.41.1
3.41.2
2 changes: 2 additions & 0 deletions atlassian/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .confluence import Confluence
from .crowd import Crowd
from .insight import Insight
from .insight import Insight as Assets
from .jira import Jira
from .marketplace import MarketPlace
from .portfolio import Portfolio
Expand All @@ -27,4 +28,5 @@
"MarketPlace",
"Xray",
"Insight",
"Assets",
]
16 changes: 16 additions & 0 deletions examples/insight/create_object_in_assets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from atlassian import Assets

# Press the green button in the gutter to run the script.
if __name__ == "__main__":
assets = Assets(url="http://localhost:8080/", username="jira-administrator", password="admin")

object_type_id = 3520 # Contract

assets.create_object(
object_type_id=object_type_id,
attributes=[
{"objectTypeAttributeId": 38, "objectAttributeValues": [{"value": "Expenses"}]}, # Contract Name
{"objectTypeAttributeId": 46, "objectAttributeValues": [{"value": "OPEX"}]}, # Contract Type
{"objectTypeAttributeId": 48, "objectAttributeValues": [{"value": "Expired"}]}, # Contract Status
],
)

0 comments on commit 176da86

Please sign in to comment.