Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public with sharing class GetIssues {
- public static void Getfields(String JIRA_Key) {
- HttpRequest req = new HttpRequest();
- HttpResponse res = new HttpResponse();
- Http http = new Http();
- String username = 'admin';
- String password = 'admin';
- Blob headerValue = Blob.valueOf(username+':'+password);
- String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
- req.setHeader('Authorization', authorizationHeader);
- req.setHeader('Content-Type','application/json');
- String endpoint = 'https://mysfjira.atlassian.net/rest/api/2/issue/'+JIRA_Key;
- req.setMethod('GET');
- req.setEndpoint(endpoint);
- res = http.send(req);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement