Advertisement
Guest User

Untitled

a guest
Mar 31st, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. public with sharing class GetIssues {
  2.  
  3. public static void Getfields(String JIRA_Key) {
  4.  
  5. HttpRequest req = new HttpRequest();
  6. HttpResponse res = new HttpResponse();
  7. Http http = new Http();
  8.  
  9. String username = 'admin';
  10. String password = 'admin';
  11.  
  12.  
  13. Blob headerValue = Blob.valueOf(username+':'+password);
  14. String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
  15. req.setHeader('Authorization', authorizationHeader);
  16. req.setHeader('Content-Type','application/json');
  17.  
  18. String endpoint = 'https://mysfjira.atlassian.net/rest/api/2/issue/'+JIRA_Key;
  19.  
  20. req.setMethod('GET');
  21. req.setEndpoint(endpoint);
  22. res = http.send(req);
  23.  
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement