Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to automate customize field in jira #259

Open
dpruthi opened this issue Oct 3, 2019 · 1 comment
Open

How to automate customize field in jira #259

dpruthi opened this issue Oct 3, 2019 · 1 comment

Comments

@dpruthi
Copy link

dpruthi commented Oct 3, 2019

Hi Dear,

Can you please guide me how this api helps me to automate custom jira field.

Automate: 'Yes'/'No'

I have a custom field in my jira ticket name 'Automate' having 'yes/no' option.

@hari1985
Copy link

hari1985 commented Nov 6, 2019

@dpruthi - Here is the detailed implementation. Hope this helps.

private static String getCustomField(String fieldName, Issue issue) { Map customFieldMap = (Map) issue.getField(fieldName); return customFieldMap.get("value").toString(); }

Enum: BRAND("customfield_15516") -> You can get the field name by visiting the REST Jira API which will give you the custom field values where you can punch those in the above Enum.

Jira REST API: https://jira.yourdomain.com/rest/api/latest/issue/issue-key

I have the POJO where I'm setting the required fields for update in Jira.
jiraIssuePojo.setDpTeam(getDpTeamValue(getCustomField(CustomField.DPTEAM.getJiraCustomField(), dpTeam))); try { jiraReportImpl.updateFateIssue(jiraIssuePojo); LOGGER.info("FATE Updated with Components/Fabric URL for {} ", jiraIssuePojo.getIssueKey()); } catch (JiraException e) { e.printStackTrace(); }
Btw you have to build the 0.6-SNAPSHOT jar from jira-client in-order to update the Custom Fields.

0.5 version won't support for CustomFields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants