Beispiel #1
0
 def generate(self):
     issues_stream = Issues(authenticator=self.authenticator,
                            domain=self._domain)
     for issue in issues_stream.read_records(
             sync_mode=SyncMode.full_refresh):
         for index in range(random.randrange(1, 6)):
             payload = json.dumps({
                 "timeSpentSeconds":
                 random.randrange(600, 12000),
                 "comment": {
                     "type":
                     "doc",
                     "version":
                     1,
                     "content": [{
                         "type":
                         "paragraph",
                         "content": [{
                             "text": f"I did some work here. {index}",
                             "type": "text"
                         }]
                     }],
                 },
                 "started":
                 "2021-04-15T01:48:52.747+0000",
             })
             self.generate_record(payload,
                                  stream_slice={"key": issue["key"]})
Beispiel #2
0
 def generate(self):
     issues_stream = Issues(authenticator=self.authenticator,
                            domain=self._domain)
     for issue in issues_stream.read_records(
             sync_mode=SyncMode.full_refresh):
         payload = json.dumps({
             "application": {
                 "name": "My Acme Tracker",
                 "type": "com.acme.tracker"
             },
             "globalId": "system=https://www.mycompany.com/support&id=1",
             "relationship": "causes",
             "object": {
                 "summary": "Customer support issue",
                 "icon": {
                     "url16x16":
                     "https://www.mycompany.com/support/ticket.png",
                     "title": "Support Ticket"
                 },
                 "title": "TSTSUP-111",
                 "url": "https://www.mycompany.com/support?id=1",
                 "status": {
                     "icon": {
                         "url16x16":
                         "https://www.mycompany.com/support/resolved.png",
                         "link":
                         "https://www.mycompany.com/support?id=1&details=closed",
                         "title": "Case Closed",
                     },
                     "resolved": True,
                 },
             },
         })
         self.generate_record(payload, stream_slice={"key": issue["key"]})
Beispiel #3
0
 def generate(self):
     issues_stream = Issues(authenticator=self.authenticator,
                            domain=self._domain)
     for issue in issues_stream.read_records(
             sync_mode=SyncMode.full_refresh):
         payload = None
         self.generate_record(payload, stream_slice={"key": issue["key"]})
Beispiel #4
0
 def generate(self):
     issues_stream = Issues(authenticator=self.authenticator,
                            domain=self._domain)
     for issue in issues_stream.read_records(
             sync_mode=SyncMode.full_refresh):
         for index in range(20):
             payload = json.dumps({
                 "body": {
                     "type":
                     "doc",
                     "version":
                     1,
                     "content": [{
                         "type":
                         "paragraph",
                         "content": [{
                             "text":
                             "Lorem ipsum dolor sit amet, consectetur adipiscing elit. "
                             "Pellentesque eget "
                             "venenatis elit. Duis eu justo eget augue iaculis fermentum. Sed "
                             "semper quam "
                             "laoreet nisi egestas at posuere augue semper.",
                             "type":
                             "text",
                         }],
                     }],
                 }
             })
             self.generate_record(payload,
                                  stream_slice={"key": issue["key"]})